Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Refineo’s picture

Project: Drupal core » Date
Version: 7.10 » 7.x-2.x-dev
Component: base system » Code

Reassigned to Date module as this seems to be specific to this contrib module.

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

Not enough information to do anything with this. There are literally hundreds of permutations of ways you could have set up a date field and constructed the view.

Make sure you have run update.php. Edit the view and make sure all the settings still look right, and re-save it. Clear the caches.

Then if you still have a problem you need to describe how the date field is configured and how you set up the view.

Refineo’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I close this as I cannot reproduce this error after drush cc all and resaving the view.

Background information

- The site frontpage has been replaced with a view (frontpage_2)
- The site configuration redirects all call to http://www.example.com to (frontpage_2)
- The only error message appears when calling http://www.example.com directly
or http://www.example.com/frontpage_2
- This error occurs when user is already logged in as administrator and redirects to the frontpage
http://www.example.com
- The error doesn't occur for anonymous users.
- The error doesn't occur when in the view preview mode.
- The error doesn't occur when view has no date related exposed filter.
- The error doesn't occur after clearing cache and resaving the view again.
- No messages in admin/reports/dblog specific to this error appeared.

MegaphoneJon’s picture

I experienced the same problem, doing drush cc all and re-saving the view fixed it for me as well.

However, I also previously had an almost identical error:
Fatal error: Cannot create references to/from string offsets nor overloaded objects in /var/www/dev/ppnyc/includes/common.inc on line 6288

This was on Drupal 7.9 (or maybe 7.8), so it might or might not be the same code. In that case, I didn't have two date filters on my view, but rather one date filter with a "between". Replacing the "between" with two date filters fixed the issue for me (until now, but hopefully that was a fluke).

Also of note - I would get this error when loading the view, but if I edited the view, I wouldn't get this error - and if I viewed the view FROM edit mode, I also wouldn't get this error. I don't think that's terribly helpful for closing the bug, but possibly useful for others who need a workaround.

anavrin’s picture

I had exactely the same problem:

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

I have a view with exposed filter with date field from - to (date range).

Same thing helped: "drush cc all" and saving a view again.

OldAccount’s picture

I have a page displaying 2 blocks that both have a "between" date exposed filter. Doing a "drush cc all" and re-saving the view seems to clear up the issue, however I have to start a new user session for it to work, otherwise it keeps giving the error.

OldAccount’s picture

Nevermind, the error is back again. This time on a view that only has 1 date "between" exposed filter. "Drush cc all", re-saving the view, and restarting the user session didn't help.

Refineo’s picture

Status: Closed (cannot reproduce) » Active

@PalanteJon, @anavrin, @Irobeson, I suggest we reopen this issue but we need more information as @KarenS asks in #2.

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

Nothing will happen with this unless someone provides steps to reproduce.

Refineo’s picture

Status: Postponed (maintainer needs more info) » Active

The issue disappears when cloning a view and saving with a new url-path.

This and some open issues I found concerning PHP itself suggest the issue is with PHP and caching.
I use APC and Boost caching.

I will try to verify this later on.

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

Please don't re-mark this as active until you have given me enough information to reproduce the problem. You have not yet told me anything that would allow me to reproduce the issue.

klopsen’s picture

Status: Postponed (maintainer needs more info) » Active
FileSize
2.79 KB

I've got the same error. I used simple content type with date field, page view with exposed date filter and attachment.
The error doesn't appear at once, but after resfreshing/adding node/picking up a date. Sometimes to make it happen I had to do those actions couple of times, but error comes again in time.
@KarenS I include features file with content type and view I had used. Hope this will help you (or others) to come up and fix the problem. Just ask if you need more information.

Drupal 7.10
Views 7.x-3.0
Date 7.x-2.0-rc1

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

Bugs should be tested against the latest version of Date. RC1 is not the latest version. If this can't be reproduced using the latest -dev version of Date there isn't anything to fix. Please confirm that the bug still exists in that version, then tell me how to reproduce it in that version. Thanks!

klopsen’s picture

Status: Postponed (maintainer needs more info) » Active

I confirm that the bug still occurs in the latest module version (I used latest Views 7.x-3.x-dev and Date 7.x-2.x-dev). I enabled exported feature, added three nodes and the error appeared on views page.

OldAccount’s picture

FileSize
107.3 KB

The bug still occurs for me using Date 7.x-2.x-dev, Views 7.x-3.0-rc3, and Drupal 7.12. I have 2 blocks, both with Data Export options and exposed date range filters. The date ranges default to Jan 1, 2012 - Dec 31, 2012. If I leave the range as is and download the CSV, it works fine. If I change the date range and click Apply, I get the error. Even if I don't change the date range, clicking Apply and then clicking the CSV download link still causes the error.

The same exact thing happens on my production site that's using Date 7.x-2.0-alpha5, Views 7.x-3.0rc3, and Drupal 7.10.

I'm attaching my exported View in case that helps.

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

I can't do anything with this unless someone tells me how I would reproduce it on a fresh install with only Date and Views installed. If you can't reproduce it with only Date and Views there is some interaction with other modules.

I can't do anything with that exported view, and I don't know what "both with Data Export options" means. The view above has a ton of non-standard fields in it so I can't use it, and I assume "Date Export optons" means there is some other module being used here.

klopsen’s picture

FileSize
7.32 KB

@Karen: I attached feature with view and content type I used here. If you don't want to use feature module I attach the same view now. 'Event' content type contains only one extra field 'field_event_date'. Error occurs even with only views and date modules intalled.
To reproduce error (in my case) just add new node and go to view page ('/date-test').

klopsen’s picture

Status: Postponed (maintainer needs more info) » Active
OldAccount’s picture

My apologies, I thought the exported file would help.

After a day of trial and error, I believe my issue is with Views Data Export, not Date. In my case, I was only getting the error in IE and I'm 99% sure it involves the Overlay module. Once I disabled Overlay, I stopped getting the error, maybe that will help someone else.

klopsen’s picture

In my case, error appears even with overlay module disabled. I diseable it before I enable Views or Date module. Error appears in all browsers...

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

So is this only when using the Views Data Export module? I need to know that because I can't replicate the problem.

klopsen’s picture

Status: Postponed (maintainer needs more info) » Active

Definitely not. I use only Views and Date module and error appears. As I wrote before - just try to add some nodes, use exposed date field and it should appear.

KarenS’s picture

Status: Active » Closed (cannot reproduce)

@klopsen, You have created a view that aggregates a repeating date field based on an exposed filter that defaults to being blank. So you are trying to aggregate the date value on a view that may contain lots of nodes that don't even contain that date field. I couldn't get the error message above with that view, but I got others. If I give the filter a default value it works for me initially, but you would still have trouble if someone tried to set it back to a blank value. And this is a real edge case too -- an exposed filter on a repeating field that is being aggregated.

The original report says nothing about using a view with aggregation, so I'm not sure your issue is even the same as the original one. And with your example I can't get the error in the original report.

For that matter, pretty much everything in this thread is a different issue -- the original says it is a view with two filters, nothing about them being exposed, then we have a comment about an exposed filter, nothing about aggregation, then we have a comment about an error when using the Views Data Export, no mention of exposed filters or multiple date filters, then yours which is an exposed filter that has aggregation on it.

I think this issue is covering too many totally different topics to be something I can address so I'm marking it "can't reproduce". If there are reproduceable errors in the current code I need separate issues for each one, with explicit steps to reproduce and titles the differentiate which situation we're talking about.

MegaphoneJon’s picture

It's not my intent to reopen this bug, since I don't have a clean enough environment that I could easily reproduce the bug. However, KarenS's last post made me realize that I'm also using aggregation, and perhaps that's an overlooked commonality between folks who see this bug?

My date field is not a repeating field, but I am aggregating, and I'm doing so on an exposed date filter that defaults to blank. I'm reasonably certain that if I don't touch the exposed date filter, I don't trigger this bug.

As a note, I thought that doing drush cc all and resaving with a different path fixed this for me, but I now see I was mistaken. Hope this helps someone.

MegaphoneJon’s picture

Since it doesn't seem to have been mentioned earlier - after triggering this bug, the view becomes unloadable until you do one of the two following things:
* You log out and log in again.
* You go to the Edit page for that view, then view the page via the link provided on the Edit page.

MegaphoneJon’s picture

Crap, I apologize again. I'm going to keep my mouth shut until I can document my environment more thoroughly. I want to confirm that this issue occurs even when aggregation is NOT enabled.

MegaphoneJon’s picture

OK, I know I said I'd keep my mouth shut - but I TENTATIVELY believe I worked around this bug by clearing the "Remember last selection" checkbox on my exposed date filters. I encourage other folks to try that and report back if it fixes their issue!

klopsen’s picture

Great job! It worked for me! Turning off the "Remember last selection" done everything. However it only prevents occuring bug but not solves the problem.

KarenS’s picture

@PalanteJon, if you have a reproducable error, please open a new issue and copy the explanation of how to reproduce it there. This one is polluted with too many different issues to be usable, which is why I closed it.

vthirteen’s picture

i won't open the issue again, but confirming that the error still happens when Views Export Data is disabled and the "remember field option" is checked out in all exposed fields. editing and saving the view solves the problem only temporarily. whenever i'll make more tests I'll post my findings.

Christian DeLoach’s picture

Status: Closed (cannot reproduce) » Needs review

Here is how I was able to replicate the bug, and my workaround for get things working.

  • Created a page View with a date field within the Filter Criteria where the field is exposed to the user, the operator is set to "Is between", AND the "Remember the last selection" is enabled (checked).
  • Save the View.
  • Navigate to the page View. This does not result in any errors.
  • Filter the View using the exposed date field. This also does not result in any errors. Additional changes to the exposed date filter and resubmission of the View also does not result in any errors.
  • Navigate to the page View again will result in a blank page and the server error "Cannot create references to/from string offsets nor overloaded objects in...".

To get things back up and running again, I deleted my Drupal session cookie. This will get the program working form me again until I filter the page View using the exposed date field. In order to fix the exposed filter and eliminate the bug, I was forced to disable (uncheck) the "Remember the last selection" option.

Please note, I am running version 7.x-2.5 of the Date module and version 7.x-3.3 of the Views but I have many other modules installed and have not tested the steps above on a freshly installed site using the latest development releases of Views and Date.

VivienLetang’s picture

I confirm that AHOY workaround triggered this error in my environnement too.

To suggest a way to clean this bug, please visit this issue : http://drupal.org/node/1566770. In this issue we see that views don't like the way Date module set arguments and IMHO, we got the same error here.

The Drupal Core function "drupal_array_set_nested_value" try to read the form array. When we come into the different date parts (year, month etc) in a select combobox formatter, the function crashs, because it try to find an array but get a string value (wants "year" = 2012, "month" = 06 etc but have "2012-06...").

Actually, it's impossible to get "remember tools" and "exposed date" both activated.

Hope this help.

kevinquillen’s picture

I just saw this but not with Date module.

If you have filters on a view and they are exposed, and set to 'remember last selection'- then your SESSION has filters stored in in. If you alter the view and change a filter type (like greater than to is between) then Views will try to apply your last value to the filter and cause problems.

I got around this while debugging by putting unset($_SESSION['views']) in a form alter which cleared up the issue.

KarenS’s picture

Title: Fatal error: Cannot create references to/from string offsets nor overloaded objects in /***/includes/common.inc on line 6308 » Problem using 'remember' in exposed date filter
Status: Needs review » Active

'needs work' means there is a patch. There is no patch. Changing name to be more descriptive.

hobokenskiclub’s picture

I have this issue too, thanks for the suggested workaround. I unchecked the "remember last selection" configuration option for the two date filters in my exposed form until this bug is fixed.

kevinquillen’s picture

Now I am getting this on a view with a date filter, and 'remember' is not checked for anything.

It is definitely date related, because it is the only View filter that is throwing this error. If the filter is not used in the search, it works fine.

kevinquillen’s picture

I tried the patch in #32 and updated Views to 3.x dev and still get the error.

kevinquillen’s picture

Here is a stack trace:

Fatal error: Cannot create references to/from string offsets nor overloaded objects in /Users/kevinquillen/Documents/workspace/prugallo-aegir/includes/common.inc on line 6430
Call Stack
#	Time	Memory	Function	Location
1	0.0009	331656	{main}( )	../index.php:0
2	0.1930	5880796	menu_execute_active_handler( )	../index.php:21
3	0.1932	5881244	call_user_func_array ( )	../menu.inc:516
4	0.1932	5881464	views_page( )	../menu.inc:516
5	0.2742	13877348	 view->execute_display( )	../views.module:475
6	0.4122	19358212	 views_plugin_display_page->execute( )	../view.inc:1313
7	0.4122	19358240	 view->build( )	../views_plugin_display_page.inc:216
8	0.4199	19663608	 views_plugin_exposed_form->render_exposed_form( )	../view.inc:957
9	0.4200	19664240	 drupal_build_form( )	../views_plugin_exposed_form.inc:151
10	0.4542	20206536	 drupal_process_form( )	../form.inc:374
11	0.4544	20208820	 form_builder( )	../form.inc:839
12	0.4546	20212576	 form_builder( )	../form.inc:1836
13	0.4551	20217232	 form_builder( )	../form.inc:1836
14	0.4553	20217976	 _form_builder_handle_input_element( )	../form.inc:1774
15	0.4554	20218364 	drupal_array_set_nested_value( )	../form.inc:1982

What about the date field is breaking?

I must have used this form a hundred times during development which is now suddenly not working. Some change in between 2.3 and 2.5 has broken this or introduced something in the date filtering that triggers an existing bug.

I was pretty sure that up to now, the View filter was a basic text field for the date, but now it seems to be using a date_select instead. I am modifying the view filter so it is a select drop down of Weekends, not a text input or what is now a year month day input. I need it to be smarter than that.

How do you get around this?

kevinquillen’s picture

I wound up throwing a 'helper' field in to store a unix timestamp in a Integer field instead of a Date field to bypass this filter issue. Worked.

-Mania-’s picture

From what I can gather I get the error whenever I use the "remember" option in an exposed date field. Like mentioned by other users the default display is fine, the first search is fine, but then returning to the view results in an error. The only way to get rid of the error and white screen is to clear the session e.g. log out the user. I have various other fields using "remember" and they work fine.

-Mania-’s picture

Any solutions to this issue?

micbar’s picture

Is there any way to get the "remember" option working on a exposed date filter? Change the date format?

Jaapx’s picture

seems to be duplicate of http://drupal.org/node/1485574#comment-7137908. I decribe there a workaround that worked for me and maybe also for you.

micbar’s picture

thanks!
I will try this workaround.

micbar’s picture

Issue summary: View changes

added related issues

JKingsnorth’s picture

Issue summary: View changes
jgullstr’s picture

DamienMcKenna’s picture

Lostboy22’s picture

quick fix: log out and restart browser.

Problem: There is a session cookie that is not getting set/cleared.