One of my users reported to me that, after creating his account, he could not create news articles because he would always get this error:

Fatal error: Cannot create references to/from string offsets nor overloaded objects in /home3/kpr/public_html/includes/common.inc on line 6614

I check the log messages and there were these two, in order:

Notice: Array to string conversion in drupal_attributes() (line 2373 of /home3/kpr/public_html/includes/common.inc).
Warning: Illegal string offset 'und' in drupal_array_set_nested_value() (line 6614 of /home3/kpr/public_html/includes/common.inc).

So I tried to reproduce it but it was challenging. I finally discovered that his timezone was set differently than everyone else: it was set to America/Regina. The site is defaulted to America/Chicago and that's what everybody's timezone is set to. So I created a test account with that same timezone and finally I was able to reproduce it. (Mostly, it wasn't a fatal error though it was a warning and it spit me back to an empty node form). Changing it to Chicago then fixed the issue.

So what's going on here? This may be a compatibility issue with my version of php, which is php 5.4. OS is redhat or centos or something (hosted by HostGator) served by apache, mysql, nothing weird about my setup except that it's in a sub-directory and I'm using the sites.php file to hide that fact. Let me know if you need more info. I have tons of modules installed, ones that could be relevant are Scheduled, Date, etc. but this seems to me like it's an issue with core.

Comments

dan.mantyla’s picture

Title: timezone set incorrectly causes fatal error when creating nodes » user timezone setting causes fatal error when creating nodes
dcam’s picture

Have you tried to reproduce the problem on a clean install of 7.x? Your report probably contains enough information, but just for the sake of making it easy on others if you could give us a numbered list of steps to reproduce the problem (preferably on a clean install of 7.x) then that would help get the issue resolved.

dan.mantyla’s picture

I'm starting to wonder if it doesn't have anything to do with the timezone setting. I'm still getting this error in the log messages from time to time: Warning: Illegal string offset 'und' in drupal_array_set_nested_value() (line 6651 of /home3/kpr/public_html/includes/common.inc).

dan.mantyla’s picture

Priority: Major » Normal

Version: 7.33 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.