Got lots of users reporting a fatal error with the message:

"Fatal error: Cannot create references to/from string offsets nor overloaded
objects in /home/mysite/public_html/**sites/all/modules/mollom/**mollom.module
on line 1312"

They are prevented from submitting the node they have created. Any idea why this is happening? I bet I can reproduce the problem for you, if you open up an account on our site and tell me your user name I can approve an account to show you. http://www.cctvcambridge.org/user/register

I've set this to critical since the error prevents nodes from submitting.

CommentFileSizeAuthor
#14 Picture 4.png26.22 KBseaneffel
#10 Picture 2.png68.68 KBseaneffel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

seaneffel’s picture

I notice there is a 6.x-1.9 tag on this issue queue, but the most recent release on the project page is 6.x-1.6. Have I missed something?

seaneffel’s picture

Version: 6.x-1.9 » 6.x-1.6

More information. Running tests I can see that the error turns up after the CAPTCHA is passed by the user.

Correct CAPTCHA 
Data:
  session_id = '110930eac3e21b2d48'
  captcha_result = 'fmcam'
  author_ip = '74.94.186.21'
  author_id = '2'
  post_title = 'This is a test'
  post_body = 'This is a test'
  author_name = 'Testy'
  author_mail = 'sean@crushyou.net'
Result:
true

Immediately, this following error message turns up.

Fatal error: Cannot create references to/from string offsets nor overloaded objects in /home/mysite/public_html/sites/all/modules/mollom/mollom.module on line 1312

sun’s picture

Version: 6.x-1.6 » 6.x-1.16
Priority: Critical » Major

Can you let me know what version of PHP you're on? admin/reports/status should tell.

seaneffel’s picture

Version: 6.x-1.16 » 6.x-1.6
Priority: Major » Critical

More conditional stuff.

I see that this is a problem with one content type. The content type is pretty sophisticated. It has several custom text fields, a date field, a location field, an image filefield, a CCK Link field, and several taxonomy fields. I'm going to try to isolate the field that is causing us the pains.

I notice also that the preview step during node creation brings up this error with no check against Mollom for the correct CAPTCHA.

seaneffel’s picture

Here are all the details about my webserver config: Apache/1.3.42 (Unix) PHP/5.2.9 mod_log_bytes/1.2 mod_bwlimited/1.4 mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.7a

seaneffel’s picture

Priority: Critical » Major

Sorry, I didn't see what you did there in the issue status. Setting it back.

seaneffel’s picture

Version: 6.x-1.6 » 6.x-1.16

Aaaand botched the version number. Now it should be correct.

seaneffel’s picture

I've run these operations that generate errors on a test server and found that the error doesn't present itself. Maybe this is an environmental thing, maybe not. I'm still following another hunch that its a conflict with another module being used on a content type.

Webserver config : Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2

This is the passed captcha session if that is helpful to you (or me).

Correct CAPTCHA 
Data:
  session_id = '110930c879a355722a'
  captcha_result = 'mn2sp'
  author_ip = '::1'
  author_id = '2'
  post_title = 'Third test is the charm'
  post_body = 'Third test is the charm'
  author_name = 'Testy'
  author_mail = 'sean@crushyou.net'
Result:
true
sun’s picture

Priority: Major » Normal

In that case, there must indeed be something wrong or odd with that specific content type form.

The code that is triggering the error in the Mollom module is searching the form structure for submit buttons in order to remove their values from the submitted form values (only internally to further process the form submission data within mollom.module).

The error message basically means that the submitted form values contain a string or object in a location where an array is expected; i.e., within the path from the top-level array to one of the deeper/nested button value keys in the submitted form values.

This should normally not happen. Some module must be altering the submitted form values in an odd/invalid way.

You could try to put the following line at the beginning of _mollom_form_state_values_clean() in mollom.module:

echo "<pre>"; var_dump($form_state['values']); echo "</pre>\n";

and afterwards try to submit the form again. That should show all of the actual submitted form values.

seaneffel’s picture

FileSize
68.68 KB

I stripped out all of the fields from that content type, one by one, and resubmitted the form each time. I got down to core-only fields and found that I still got the errors. Screenshot to prove it.

seaneffel’s picture

Priority: Normal » Major

I pasted that snippet at line 1281 in the mollom.module and got the following results. I don't know how to interperet them:

array(39) {
  ["nid"]=>
  NULL
  ["vid"]=>
  NULL
  ["uid"]=>
  string(1) "2"
  ["created"]=>
  int(1317413815)
  ["type"]=>
  string(4) "date"
  ["language"]=>
  string(0) ""
  ["changed"]=>
  string(0) ""
  ["title"]=>
  string(12) "A Cool Event"
  ["teaser_js"]=>
  string(0) ""
  ["teaser_include"]=>
  int(1)
  ["body"]=>
  string(62) "This will be a really cool event.  I hope you can all make it."
  ["format"]=>
  string(1) "1"
  ["name"]=>
  string(5) "Testy"
  ["date"]=>
  string(0) ""
  ["status"]=>
  bool(true)
  ["promote"]=>
  bool(false)
  ["sticky"]=>
  bool(false)
  ["op"]=>
  string(4) "Save"
  ["submit"]=>
  string(4) "Save"
  ["preview"]=>
  string(7) "Preview"
  ["form_build_id"]=>
  string(37) "form-d1b833bc4df962cf1d34ea3bc684826a"
  ["form_token"]=>
  string(32) "ed016d0ee9f07596b1b6821fe4ee8a85"
  ["form_id"]=>
  string(14) "date_node_form"
  ["taxonomy"]=>
  array(4) {
    [9]=>
    NULL
    [14]=>
    string(4) "1025"
    [11]=>
    array(0) {
    }
    [18]=>
    array(0) {
    }
  }
  ["comment"]=>
  string(1) "0"
  ["menu"]=>
  array(11) {
    ["mlid"]=>
    int(0)
    ["module"]=>
    string(4) "menu"
    ["hidden"]=>
    int(0)
    ["has_children"]=>
    int(0)
    ["customized"]=>
    int(0)
    ["options"]=>
    array(0) {
    }
    ["expanded"]=>
    int(0)
    ["parent_depth_limit"]=>
    int(8)
    ["link_title"]=>
    string(0) ""
    ["parent"]=>
    string(15) "primary-links:0"
    ["weight"]=>
    int(0)
  }
  ["path"]=>
  string(0) ""
  ["field_title_short"]=>
  array(1) {
    [0]=>
    array(2) {
      ["value"]=>
      string(12) "A Cool Event"
      ["_error_element"]=>
      string(27) "field_title_short][0][value"
    }
  }
  ["field_imagefield"]=>
  array(1) {
    [0]=>
    array(13) {
      ["UPLOAD_IDENTIFIER"]=>
      string(32) "63a9f52d5b9f15fa4a12af78d6cf12be"
      ["fid"]=>
      int(0)
      ["list"]=>
      string(1) "1"
      ["filepath"]=>
      string(0) ""
      ["filename"]=>
      string(0) ""
      ["filemime"]=>
      string(0) ""
      ["filesize"]=>
      int(0)
      ["alt"]=>
      string(0) ""
      ["title"]=>
      string(0) ""
      ["filefield_upload"]=>
      string(6) "Upload"
      ["filefield_remove"]=>
      string(6) "Remove"
      ["data"]=>
      array(2) {
        ["alt"]=>
        string(0) ""
        ["title"]=>
        string(0) ""
      }
      ["upload"]=>
      string(0) ""
    }
  }
  ["field_date_range"]=>
  array(1) {
    [0]=>
    array(5) {
      ["value"]=>
      string(19) "2014-08-05T09:20:00"
      ["value2"]=>
      string(19) "2014-08-05T09:20:00"
      ["timezone"]=>
      string(16) "America/New_York"
      ["offset"]=>
      int(-14400)
      ["offset2"]=>
      int(-14400)
    }
  }
  ["field_body_short"]=>
  array(1) {
    [0]=>
    array(2) {
      ["value"]=>
      string(33) "This will be a really cool event."
      ["_error_element"]=>
      string(26) "field_body_short][0][value"
    }
  }
  ["field_sponsor"]=>
  array(1) {
    [0]=>
    array(2) {
      ["value"]=>
      string(0) ""
      ["_error_element"]=>
      string(23) "field_sponsor][0][value"
    }
  }
  ["field_cost"]=>
  array(1) {
    [0]=>
    array(2) {
      ["value"]=>
      float(0)
      ["_error_element"]=>
      string(20) "field_cost][0][value"
    }
  }
  ["field_website"]=>
  array(1) {
    [0]=>
    array(2) {
      ["title"]=>
      string(0) ""
      ["url"]=>
      string(0) ""
    }
  }
  ["locations"]=>
  array(1) {
    [0]=>
    array(8) {
      ["name"]=>
      string(0) ""
      ["street"]=>
      string(12) "438 Mass Ave"
      ["additional"]=>
      string(0) ""
      ["city"]=>
      string(9) "Cambridge"
      ["province"]=>
      string(0) ""
      ["postal_code"]=>
      string(0) ""
      ["country"]=>
      string(2) "us"
      ["location_settings"]=>
      array(4) {
        ["multiple"]=>
        array(3) {
          ["min"]=>
          string(1) "1"
          ["max"]=>
          string(1) "1"
          ["add"]=>
          string(1) "1"
        }
        ["form"]=>
        array(4) {
          ["weight"]=>
          string(1) "3"
          ["collapsible"]=>
          int(0)
          ["collapsed"]=>
          int(0)
          ["fields"]=>
          array(14) {
            ["name"]=>
            array(3) {
              ["default"]=>
              string(0) ""
              ["collect"]=>
              string(1) "1"
              ["weight"]=>
              string(1) "2"
            }
            ["street"]=>
            array(3) {
              ["default"]=>
              string(0) ""
              ["collect"]=>
              string(1) "2"
              ["weight"]=>
              string(1) "4"
            }
            ["additional"]=>
            array(3) {
              ["default"]=>
              string(0) ""
              ["collect"]=>
              string(1) "1"
              ["weight"]=>
              string(1) "6"
            }
            ["city"]=>
            array(3) {
              ["default"]=>
              string(0) ""
              ["collect"]=>
              string(1) "2"
              ["weight"]=>
              string(1) "8"
            }
            ["province"]=>
            array(3) {
              ["default"]=>
              string(0) ""
              ["collect"]=>
              string(1) "2"
              ["weight"]=>
              string(2) "10"
            }
            ["postal_code"]=>
            array(3) {
              ["default"]=>
              string(0) ""
              ["collect"]=>
              string(1) "1"
              ["weight"]=>
              string(2) "12"
            }
            ["country"]=>
            array(3) {
              ["default"]=>
              string(2) "us"
              ["collect"]=>
              string(1) "2"
              ["weight"]=>
              string(2) "14"
            }
            ["locpick"]=>
            array(4) {
              ["default"]=>
              bool(false)
              ["collect"]=>
              string(1) "0"
              ["weight"]=>
              string(2) "20"
              ["nodiff"]=>
              bool(true)
            }
            ["lid"]=>
            array(1) {
              ["default"]=>
              bool(false)
            }
            ["latitude"]=>
            array(1) {
              ["default"]=>
              int(0)
            }
            ["longitude"]=>
            array(1) {
              ["default"]=>
              int(0)
            }
            ["source"]=>
            array(1) {
              ["default"]=>
              int(0)
            }
            ["is_primary"]=>
            array(1) {
              ["default"]=>
              int(0)
            }
            ["delete_location"]=>
            array(2) {
              ["default"]=>
              bool(false)
              ["nodiff"]=>
              bool(true)
            }
          }
        }
        ["display"]=>
        array(4) {
          ["weight"]=>
          string(1) "3"
          ["hide"]=>
          array(12) {
            ["name"]=>
            int(0)
            ["street"]=>
            int(0)
            ["additional"]=>
            int(0)
            ["city"]=>
            int(0)
            ["province"]=>
            int(0)
            ["postal_code"]=>
            int(0)
            ["country"]=>
            int(0)
            ["locpick"]=>
            int(0)
            ["province_name"]=>
            int(0)
            ["country_name"]=>
            int(0)
            ["map_link"]=>
            int(0)
            ["coords"]=>
            int(0)
          }
          ["teaser"]=>
          int(0)
          ["full"]=>
          int(1)
        }
        ["rss"]=>
        array(1) {
          ["mode"]=>
          string(6) "simple"
        }
      }
    }
  }
  ["mollom"]=>
  array(3) {
    ["session_id"]=>
    string(0) ""
    ["homepage"]=>
    string(0) ""
    ["captcha"]=>
    string(0) ""
  }
  ["og_groups_inaccessible"]=>
  array(0) {
  }
  ["og_initial_groups"]=>
  array(0) {
  }
  ["hs_form_build_id"]=>
  string(40) "hs_form_ace524f4fd330ed85c415b209c1931c8"
}

seaneffel’s picture

Not like this PHP message could be related, could it? Noticed it in the log entries near the time of my last Mollom submission. I do have date fields contained in this suspicious content type.

Object of class DateTime could not be converted to string in /home/cctvcamb/public_html/sites/all/modules/date/date_api.module on line 1188.
seaneffel’s picture

More information.

I've created a second content type with the same structure and fields as the content type with the issue. As far as I can tell, the only difference is machine-readable name of the content type. It works as intended. I can't narrow down the problem to a specific field, but I think this may indicate that this is an issue with this specific content type. In the long term, this is probably an issue that someone else will have and it would be nice to single out the issue. Does what I have shared here make it any easier to pinpoint the problem?

In the short term, I am likely to change the workflow of my users to author nodes of this new content type instead of the old. I'll need to update views and blocks.

seaneffel’s picture

FileSize
26.22 KB

Found. What a super annoying problem to diagnose.

The fatal error pops up because of the Hierarchical Select 6.x-3.7 module. I have two taxonomy vocabularies on this content type, both configured with HS but only one difference. The "save lineage" setting breaks the Mollom module when it is set to "Save only the deepest term". See attached screenie.

Changing the setting to "Save term lineage" allows the node to submit properly. I have done so for my site in order to get the users happy.

Now how can we fix this for everyone? Does this issue still belong in the Mollom queue?

seaneffel’s picture

Title: Fatal error: Cannot create references to/from string offsets nor overloaded objects » Hierarchical Select taxonomy module causes fatal error on Mollom submission
seaneffel’s picture

Project: Mollom » Hierarchical Select
Version: 6.x-1.16 » 6.x-3.7

Fine, changing queues to the Hierarchical Select module. See if it gets any love over there.

js’s picture

I have this problem as well. @seaneffel, thank you for all your investigative time.

stefan.r’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

6.x issue without activity for over 3 years, closing.

Feel free to reopen if this is still an issue.