An unexpected error was returned: 'Array passed to Insert Query'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mittac
    Member
    • Feb 2014
    • 93
    • 5.0.X

    #16
    An unexpected error was returned: 'key: settings, value: Array ( [size] => small ) '

    or An unexpected error was returned: 'key: settings, value: Array ( [size] => medium ) '

    Comment

    • mittac
      Member
      • Feb 2014
      • 93
      • 5.0.X

      #17
      If you do not choose a size - there is no error

      Comment

      • glennrocksvb
        Former vBulletin Developer
        • Mar 2011
        • 4011
        • 5.7.X

        #18
        Can you change to this to get more info?

        PHP Code:
        throw new Exception("key: $key, value: " print_r($valuetrue) . ", table: $table, values: " print_r($valuestrue)); 

        Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

        Comment

        • mittac
          Member
          • Feb 2014
          • 93
          • 5.0.X

          #19
          'key: settings, value: Array ( [size] => medium ) , table: attach, values: Array ( [#type] => i [filedataid] => 10231 [filename] => tt.jpg [settings] => Array ( [size] => medium ) [nodeid] => 51075 ) '

          Comment

          • Wayne Luke
            vBulletin Technical Support Lead
            • Aug 2000
            • 73981

            #20
            If you save it without the size and then edit the photo by double-clicking on it, can you save the size without error?
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment

            • mittac
              Member
              • Feb 2014
              • 93
              • 5.0.X

              #21
              Originally posted by Wayne Luke
              If you save it without the size and then edit the photo by double-clicking on it, can you save the size without error?
              After editing is still an error

              Click image for larger version  Name:	t1.jpg Views:	1 Size:	125.3 KB ID:	4368603



              Comment

              • mittac
                Member
                • Feb 2014
                • 93
                • 5.0.X

                #22
                If you edit a previously saved photo - no errors

                Comment

                • Wayne Luke
                  vBulletin Technical Support Lead
                  • Aug 2000
                  • 73981

                  #23
                  I cannot recreate this on a test site using the default English language pack. Can you give the explicit steps you go through to trigger the error? What you click on, what you type into the forms, what content type you're using, how you're uploading the image. Names of example problem files would help as well.
                  Translations provided by Google.

                  Wayne Luke
                  The Rabid Badger - a vBulletin Cloud demonstration site.
                  vBulletin 5 API

                  Comment

                  • mittac
                    Member
                    • Feb 2014
                    • 93
                    • 5.0.X

                    #24
                    Click image for larger version

Name:	st1.jpg
Views:	110
Size:	140.5 KB
ID:	4368616
                    Click image for larger version

Name:	st2.jpg
Views:	88
Size:	171.5 KB
ID:	4368617
                    Click image for larger version

Name:	st3.jpg
Views:	83
Size:	185.2 KB
ID:	4368618

                    I can give the website address and test account for the experiment

                    Comment

                    • mittac
                      Member
                      • Feb 2014
                      • 93
                      • 5.0.X

                      #25
                      Click image for larger version

Name:	tt.jpg
Views:	86
Size:	12.3 KB
ID:	4368620

                      test image

                      Comment

                      • Wayne Luke
                        vBulletin Technical Support Lead
                        • Aug 2000
                        • 73981

                        #26
                        Do you have the same issues on this site?
                        Translations provided by Google.

                        Wayne Luke
                        The Rabid Badger - a vBulletin Cloud demonstration site.
                        vBulletin 5 API

                        Comment

                        • mittac
                          Member
                          • Feb 2014
                          • 93
                          • 5.0.X

                          #27
                          No, it's all good on this site. The problem is only on my site. Everything was fine before the update

                          Comment

                          • glennrocksvb
                            Former vBulletin Developer
                            • Mar 2011
                            • 4011
                            • 5.7.X

                            #28
                            I see exactly what the issue is but I don't know how it happened.

                            It looks like the passed value is not serialized and kept as an array. It would take a while to trace it to see how it happened. So I suggest doing this temporary hack/workaround for now:

                            Replace the throw statement with this block of code:

                            PHP Code:
                            if ($table == 'attach' AND $key == 'settings') {
                                
                            $value serialize($value);
                                
                            $new_values[$key] = $this->quotechar $this->db->escape_string($value) . $this->quotechar;
                            }
                            else {
                                throw new 
                            Exception('Array passed to Insert Query');

                            Note that this is not tested. Do it at your own risk.

                            Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

                            Comment

                            • mittac
                              Member
                              • Feb 2014
                              • 93
                              • 5.0.X

                              #29
                              Thank you. The error went missing

                              Comment

                              • glennrocksvb
                                Former vBulletin Developer
                                • Mar 2011
                                • 4011
                                • 5.7.X

                                #30
                                Glad to help. That's just a temporary solution. A real fix needs to be done. Somewhere somehow the passed size is not serialized for some reason.

                                Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

                                Comment

                                Related Topics

                                Collapse

                                Working...