I'm getting the following runtime error in my PHP's error_log:

[Thu Jul 31 20:54:59 2014] [error] [client 98.176.242.59] PHP Fatal error: Cannot create references to/from string offsets nor overloaded objects in /var/www/drupal-7.27/includes/common.inc on line 6606, referer: http://myserver/mypath/summary?field_log_time_value%5Bvalue%5D%5Byear%5D...

and that URL results in a blank (white) screen.

I searched for this PHP error and saw a posting where someone said they upgraded their PHP and it fixed their problem. So I upgraded from 5.3.3 to 5.5.14 but the error and problem persist.

Please help!

(Note, I tried to search for the above title in the 7.27 core issues but got a blank page instead so please excuse this posting if it is duplicate or answered elsewhere. If it is answered elsewhere, I would appreciate a link to that page, thanks!)

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

monaw’s picture

Issue summary: View changes
dcam’s picture

Status: Active » Postponed (maintainer needs more info)

Hello! I'm sorry you're experiencing this problem. Unfortunately, there's probably not enough information here to debug it.

The only reason I qualified that statement with "probably" is because of the URL you included in your post. I see a field name in it, field_log_time_value. Are you familiar with this field? Is it part of a contributed module? If so, has that module been updated? Have you tried uninstalling it and reinstalling it?

Otherwise, a good starting point would be to tell us how to reproduce the issue with a clean install of Drupal 7. If you can't, let us know what contributed modules you have installed. Enable them on a clean test site one-by-one until you can reproduce the error.

It sounds to me like there is a bug in a contrib module that you're using, so that is where I would check.

monaw’s picture

Thank you for your reply dcam.

"field_log_time_value" is a field in a View. The field comes from one of my content types so it does NOT come from a contributed module.

Perhaps I should post the problem in the Views module? There error message pointed to core's common.inc so that's why I'm posting it here...please let me know if you feel I should post the problem in the Views issue queue or work on reproducing the problem with a clean install of 7...thanks!

dcam’s picture

Ok, that's helpful to know. I should have guessed that it's a view. I did notice that it looked like a search query string.

I doubt that this is a core issue. Something is mis-using the core API function drupal_array_set_nested_value(), calling it with an incorrect parameter. Line 6606 is the function declaration. Views may be doing it, but I can't know for certain. Ultimately, I think you'll have to report this in a contrib issue queue.

Although you may be having trouble with Views, it may not be Views' fault. You didn't mention what module is creating this date field. I'll assume it's the Date module. Like most other contributed modules that provide fields, Date has to tell Views how to interact with its field. So it's possible (I would dare to say that it's likely) that the field-providing module is the one at fault. So check that module's issue queue for other reports of this problem.

Before that, however, I would check some other things. I notice that this particular URL has two query parameters for the same field. Of course, I can see that this is a multi-valued date field, but I wonder if it works correctly in the fallback case. What happens if there is no month parameter and then if there are no parameters? Does it work in either of those cases? It might be useful information for the contrib maintainers to know.

dcam’s picture

I forgot to say that this may be unrelated to the date field. It could be caused by some other field that the view is using. Have you tried removing components (fields/filters/sorts) from the view one-by-one until the problem stops? That could help you narrow down the problem.

monaw’s picture

> You didn't mention what module is creating this date field. I'll assume it's the Date module.

Yes, the date field is using the Date module. I've reported the problem to that module's issue queue (https://www.drupal.org/node/2315365). There is a new runtime error about the Date module now that appears before the common.inc error so you are probably right about the Date module causing the problem.

> What happens if there is no month parameter and then if there are no parameters? Does it work in either of those cases?

If there is no month parameter in the URL, then a warning is displayed that says "Please choose a month". If there is no parameters at all, then that's when I get the white screen and the PHP fatal error message posted at the start of this issue.

jelo’s picture

I had this with an exposed date field. Details posted at https://www.drupal.org/node/1995056

vaza18’s picture

Version: 7.27 » 7.32
Component: comment.module » forms system
Status: Postponed (maintainer needs more info) » Needs work
FileSize
50.09 KB
15.44 KB
7.59 KB
195.5 KB

Steps to reproduce:

  1. Create node with date field (date module)
  2. Create views with this node type and with exposed filter by date field with select widget. Limit to 10 the number of nodes on one page, leave pagination enabled
    views exposed filter by date.png
  3. Create more than 10 nodes of this type
  4. Open the view with list of nodes and exposed filter
  5. In the pagination right mouse click on 2nd page -> open in new tab
    open second page in new tab.png
  6. You will see that exposed options became arguments in the URL:
    exposed_options_are_arguments_in_the_url.png
  7. And here is where a magic starts. Date format expects arrays in arguments but let's change it to string:
    manually_input_arguments_in_url.png
vaza18’s picture

vaza18’s picture

vaza18’s picture

Status: Needs work » Needs review
vaza18’s picture

FileSize
742 bytes
PASSED: [[SimpleTest]]: [MySQL] 41,159 pass(es). View

This solution looks better than previous one.

vaza18’s picture

Version: 7.32 » 7.35

Status: Needs review » Needs work

jcarrothers’s picture

The patch from comment #12 solved my issue. Tested under Dupal core 7.36

dcam’s picture

Status: Needs review » Closed (duplicate)

#1995056: Exposed grouped filter gives WSOD+error "Cannot create references to/from string offsets nor overloaded objects" confirms that this is an issue with Views. For those of you who are experiencing the problem, try the patch in #1995056-6: Exposed grouped filter gives WSOD+error "Cannot create references to/from string offsets nor overloaded objects". If it solves your problem please report back to that issue and consider setting it to RTBC. I'm closing this issue as a duplicate.

@vaza18
We appreciate your attempt to patch the issue, but unfortunately it's no good. While it might stop the problem, it's not a solution. It's just a workaround that's masking problems with forms.

vaza18’s picture

OK, but original problem has not been solved so far. That's why the patch from comment #12 is only way to workaround an error at the moment.

dready2011’s picture

ameyj’s picture

Patch #25 in https://www.drupal.org/node/1995056#comment-10768266 didn't fix the issue for me. However Patch from Comment #12 in this thread fixed it for me. Is this patch ever going to make it to core or is this still thought of as a duplicate?

SocialNicheGuru’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

Number #12 from this queue fixed it. the other issue does not. https://www.drupal.org/node/1995056

Fabianx’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs issue summary update

Could someone please update the issue summary?

This is a really hard to understand bug and I don't get neither how it happens nor why the patch would fix it.

attiks’s picture

Version: 7.35 » 7.52

Ran into the same error after updating to 7.52 (including lots of contrib updates), requested page is /node/add

in drupal_array_set_nested_value called at /srv/www/html/includes/common.inc (6769)
in drupal_array_set_nested_value called at /srv/www/html/includes/form.inc (2098)
in _form_builder_handle_input_element called at /srv/www/html/includes/form.inc (1865)
in form_builder called at /srv/www/html/includes/form.inc (1927)
in form_builder called at /srv/www/html/includes/form.inc (1927)
in form_builder called at /srv/www/html/includes/form.inc (886)
in drupal_process_form called at /srv/www/html/includes/form.inc (386)
in drupal_build_form called at /srv/www/html/includes/form.inc (131)
in drupal_get_form called at /srv/www/html/modules/node/node.pages.inc (78)
in node_add called at ? (?)
in call_user_func_array called at /srv/www/html/includes/menu.inc (527)
in menu_execute_active_handler called at /srv/www/html/index.php (21)
attiks’s picture

#23 I've used the patch in #1995056-25: Exposed grouped filter gives WSOD+error "Cannot create references to/from string offsets nor overloaded objects" and it fixed most of the errors we got, but I also needed the patch #12 from this issue. Both patches were applied 7 days ago, errors are gone and no side effects.

RTBC for me, but will leave it as NR

Fabianx’s picture

#25: Could you explain a little more when and why this error happens, please?

And especially: Do you have steps to reproduce this on a core vanilla Drupal?

oturpin’s picture

Hi All,

Applied patch #12 AND the patch in #1995056-25: Exposed grouped filter gives WSOD+error "Cannot create references to/from string offsets nor overloaded objects" : No more error...

What is the release of drupal that will contain this patch ?

Thx

jozzy_a’s picture

Version: 7.52 » 7.53

:BUMP: for this patch to be merged into core. This issue exists on 7.53 as well and becomes an issue when migrating from PHP 5.4 to PHP 7.1

gifad’s picture

FWIW, I had this error in any node/add/%type or node/%node/edit if I click "Save" after "Preview".

Drupal 7.54, php 7.0.14, nothing fancy, except "book" module is active…

Patch at #12 fixes the issue !

Fabianx’s picture

Issue tags: +PHP 7.1, +PHP 7

Tagging with PHP 7

bendev’s picture

patch #12 successfully solved the issue in my case as well