With views, using date (7.x-2.2) with a "from" and a "to" field, that are exposed, and checking the remember box I get the following message:
fatal error: cannot create references to/from string offsets nor overloaded objects in public_html/info/includes/common.inc on line 6392

This only happens after making a selection in the date field and then returning to the view. When I uncheck remember the selection the problem no longer shows up.

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


dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

The wsod handbook page, gives you a lot of advisory to get more context about the issue: http://drupal.org/node/158043

For example it would be interesting whether there are any php errors connected with the remember issue.

tommann’s picture

On the site log there is nothing only this saved (40 iterations) on the server log file:

[14-Mar-2012 10:21:40] PHP Fatal error: Cannot create references to/from string offsets nor overloaded objects in /home/persian/public_html/info/includes/common.inc on line 6392

dawehner’s picture

Thanks for the bug, though this could be caused by multiple issues.

The following two things would be helpful: A backtrace at this function and a way to reproduce the problem. Most of the time fixing the issue is then not that hard anymore.

tommann’s picture

I did not know what a backtrace is so now I have added the devel module. Can you explain the steps.

To reproduce I think a significant number of nodes 400+ with a date field, then a view with two exposed date selections, >=date and <= date, using year. Then on both tick the remember option.

The page is here: http://info.bic.org/statements-and-reports/statements but currently the remember feature is off.

The reason I feel it involves the remember feature is that is always worked on first visit and then the second time errors out.

Edsel’s picture

Project: Views » Date
Issue summary: View changes


esmerel’s picture

Project: Date » Views
Status: Postponed (maintainer needs more info) » Active
calefilm’s picture

the "remember" option doesn't have anything to do with it, at least not for me.

I'm getting the same error. I can't use my "expose" date selector in views. Everything shuts down on that particular view and I get a white page:

"Fatal error: Cannot create references to/from string offsets nor overloaded objects in /Users/me/Sites/acquia-drupal/includes/common.inc on line 6392"

calefilm’s picture

More info on another thread: http://drupal.org/node/913528

patoshi’s picture

im also having the same issue.

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

im getting this in my view when i check off a couple of sortable table columns under the "tabular settings" display.


when i uncheck them, the view starts to work again. what could the cause of this be? it says overloaded, as im guessing its my view as it is loading alot of fields for tracking inventory: http://img62.imageshack.us/img62/2594/croppercapture199.jpg

** correction **

it is indeed something with the exposed filter "remember" checkbox. this error shows up now after i submit the filter once and then try to reload.

Jehu’s picture

can reproduce same error by usage of exposed filter "remember" (date field in my case)

benschaaf’s picture

Same issue here.

"Remember" setting seems to be the culprit.

budda’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
Priority: Normal » Major

We've seen the same PHP fatal error with and without the remember checkbox on in the Views config.

Stack trace is:

( ! ) Fatal error: Cannot create references to/from string offsets nor overloaded objects in /home/quickstart/websites/drupalsite.dev/includes/common.inc on line 6448
Call Stack
#       Time    Memory  Function        Location
1       0.0003  330628  {main}( )       ../index.php:0
2       0.6394  47010388        menu_execute_active_handler( )  ../index.php:21
3       0.6396  47011064        call_user_func_array ( )        ../menu.inc:516
4       0.6396  47011444        views_page( )   ../menu.inc:0
5       0.7329  60519980        view->execute_display( )        ../views.module:466
6       0.8451  70219236        views_plugin_display_page->execute( )   ../view.inc:1244
7       0.8451  70219280        view->build( )  ../views_plugin_display_page.inc:215
8       0.8528  70557032        views_plugin_exposed_form->render_exposed_form( )       ../view.inc:935
9       0.8528  70558028        drupal_build_form( )    ../views_plugin_exposed_form.inc:136
10      1.1842  71648068        drupal_process_form( )  ../form.inc:376
11      1.1843  71650380        form_builder( ) ../form.inc:844
12      1.1845  71654396        form_builder( ) ../form.inc:1853
13      1.1849  71660120        form_builder( ) ../form.inc:1853
14      1.2073  71743048        form_builder( ) ../form.inc:1853
15      1.2079  71743672        _form_builder_handle_input_element( )   ../form.inc:1791
16      1.2080  71744204        drupal_array_set_nested_value( )        ../form.inc:1999
dawehner’s picture

Project: Views » Date
Version: 7.x-3.x-dev » 7.x-2.x-dev
Component: exposed filters » Views Filter

This all seems to be a problem related to the date module, not views itself, as everyone with problems actually talked about that.

Lann’s picture

I am experiencing this same issue with Dates when the filter is exposed. It only seems to occur when I am using select boxes and not when using a date popup. Also, it does not immediately occur with the select boxes but occurs after a few refreshes.

emilflatz’s picture

Same issue here. Views Page using Exposed filter with date field. Filter is exposed with select boxes and 'remember last selection' option.
Page View works without 'remember last selection' option.

Fatal error: Cannot create references to/from string offsets nor overloaded objects in /home/jedannul/public_html/dev/includes/common.inc on line 6518


Jaapx’s picture

Same issue here with an exposed filter for a date on views.
When the filter is changed to non-exposed, the view works. Make the filter exposed again, the message returns:

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


Solution that seems to work:
Before the exposed date I added an extra date filter with the operator 'Is not empty (not NULL)'. After that the query worked normal again.

A possible explanation for this behaviour is that the query contained joins wich made it possible that the Null values are selected because of missing entities. With the extra selection these date fields are omitted before the exposed filter. A better solution is to make the exposed filter more robust.

manicato’s picture

can reproduce same error by usage of exposed filter "remember" with 2 date fields

#15 doesn't work in my case

hoangdk80’s picture

Exact same issue here.

When enabling "remember last" and reloading the page, the error occurs.

#15 doesn't work for me neither

KarlShea’s picture

This is happening for me in drupal_array_set_nested_value() in common.inc.

On line 6548, $ref is being reset to &$ref[$parent]. What's throwing the error here is when $ref gets down to the date (so $ref = '2013-04-26'). $parent is still 'year', so it tries to find an array index of a string.

Exploratus’s picture

Happening to me as well when I put remember last on a Date field. When I come back to the page I get the WSD.
It seems to do it when a select dropdown is enabled, rather than a text field.

savageanne’s picture

Setting Date fields to text rather than drop down also worked for me.

jrochate’s picture

I found the same exact problem/symptom: when enabling "remember last..." and using select boxes on exposed filter, I get WSOD but nothing on error.log.

keep up

silurius’s picture

I am experiencing this issue with 7.x-2.6. Is anyone else?

The symptoms are not affected by setting/unsetting "Remember last", setting as exposed/non-exposed, or changing the field from pop-up to text.

criznach’s picture

I spent some time debugging this, and I'm not sure the problem is specifically the date module. It might be the way views stores compound fields in the session when the remember option is selected. I can't think of another compound field filter to test, but I suspect others would behave the same.

My date filter is for year granularity only, and I was able to work around this issue by setting the filter to a text field and adding the code below in a custom module. The remember option now works, and the filter is shown as a select.

function mymodule_form_views_exposed_form_alter(&$form, &$form_state) {
  // You could optionally check current_display here too
  if ($form_state['view']->name == 'news') {
    // Just to ensure that the view hasn't been modified in an incompatible way.
    if (isset($form['y']) && $form['y']['value']['#type'] == 'date_text' && $form['y']['value']['#date_format'] == 'Y') {
      // Change the text field to a standard select
      $form['y']['value']['#type'] = 'select';
      // You could get as fancy as you want when building the options, just be sure the keys are valid years
      $form['y']['value']['#options'] = array('' => '- Year -', '2011' => '2011', '2012' => '2012', '2013' => '2013');
criznach’s picture

Looks like it is most likely a date bug. The geofield proximity filter is a compound element, and it handles the remember option fine.

grimal’s picture

Same problem here, i've an exposed date field with min/max year selects and remember option.

I've noticed that the $form_state store the date without the year/month/day date structure needed for the selects , so the year 2013 is stored in $form_state['input']['field_mydate']['min'] instead of $form_state['input']['field_mydate']['min']['year']

This fix the problem in my case:

function mymodule_custom_form_alter(&$form, &$form_state, $form_id) {
  if($form_id == 'views_exposed_form'){    
    if($form_state['input']['field_mydate']['min'] && !is_array($form_state['input']['field_mydate']['min'])){
      $form_state['input']['field_mydate']['min'] = array('year'=>$form_state['input']['field_mydate']['min']);
      $form_state['input']['field_mydate']['max'] = array('year'=>$form_state['input']['field_mydate']['max']);

any idea where we need to look for resolve the issue? date module, views/session serialization?

DnaX’s picture

Same issue here.

View with date field exposed with month granularity and rendered as selects (year and month select).

In my case I have this date field array ($form_state['input']):

[created] => Array
            [value] => Array
                    [year] => 2013
                    [month] => 9

At the second visit I have:

[created] => Array
            [value] => 2013-09
DnaX’s picture

Issue summary: View changes


Bitvark’s picture

Solution #15 worked for me: Before the exposed date I added an extra date filter with the operator 'Is not empty (not NULL)'.

I've used the select widget and setted granularity equal to my exposed filter (month).

gjlook’s picture

Issue summary: View changes

i got the same thing
fatal error: cannot create references to/from string offsets nor overloaded objects in my_path_and_inc_file on line 6392
took the remember my last selection check box off my view exposed filter , saved and hopefully working now - many thanks

jgullstr’s picture

3.97 KB

Attached a feature (view + content type) for reproduction. The issue seems, as previously mentioned, to be that "Remember last" is saved and loaded as a string, but interpreted as a date array when revisiting the view.

jgullstr’s picture

Status: Active » Needs review
1.81 KB
PASSED: [[SimpleTest]]: [MySQL] 5,242 pass(es). View

This error occurs due to date_select_validate() setting the submitted form value to a date string before views "remembers" the value. When re-visiting the form, the saved (string) value is interpreted as a date array by date_select_element_value_callback.

One workaround to this behavior is to have views save the original submitted values instead of the date string value set by date_select_validate. Another way would be to pre-process the saved date sting into a granular date array before loading the exposed form.

Attached patch works by saving the original submitted value(s) to its own array in the $form_state, and replaces the date strings generated by date_select_validate before persisting the selected values.

grasmash’s picture

2.3 KB
PASSED: [[SimpleTest]]: [MySQL] 5,283 pass(es). View

This patch was not applying cleanly via drush make. Updating.

Daniel Korte’s picture

Patch #32 works for me using version 7.x-2.9. Thanks!

dmitryVL’s picture

Assigned: Unassigned » dmitryVL

Status: Needs review » Needs work
dmitryVL’s picture

Status: Needs work » Closed (cannot reproduce)

Can't reproduce with Date(7.x-2.2) and Views 7.x-3.13.

Daniel Korte’s picture

Status: Closed (cannot reproduce) » Needs review

I can still reproduce this issue in 7.x-2.10 and the patch #32 still fixes it.