As the title says:

Fatal error: Only variables can be passed by reference in [PATH]/modules/views/handlers/views_handler_filter_date.inc on line 77

I just started getting this error this week (last week it was fine). It is possible my webhost upgraded the version of PHP on my server, and it's also possible that my Views version is outdated, so if this issue has been fixed in the most recent stable version, just say so and I'll upgrade. :)

CommentFileSizeAuthor
#10 833220-form_error-fix.patch601 bytesdawehner

Comments

merlinofchaos’s picture

It does sound like a PHP 5.3 compatibility issue that has since been fixed, but I honestly don't remember everything that's gone into the last 5 releases. =)

SpikeX’s picture

Well then I'll try upgrading.

SpikeX’s picture

Version: 6.x-2.6 » 6.x-2.9

(Marked as 2.9, but it's actually 2.11, someone needs to update the tracker info)

I just upgraded to 2.11 and still have this problem.

Line 77 says:

form_error($form['value'], t('Invalid date format.'));

And I'm assuming it's referring to $form['value'], so... anyone have any ideas? This code is inside the date validation function, and it's running this code because it wants to print an Invalid date format to me, but I've actually inputted a correct date format for PHP's strtotime (I used this as a test date/time: 2010-06-01 12:00:00, and clearly it's not working because it's getting to the "Invalid date format" code point).

Ideas?

merlinofchaos’s picture

2.11 is in there but it's sorted after 2.1 due to the way strings are sorted.

merlinofchaos’s picture

Version: 6.x-2.9 » 6.x-2.11
SpikeX’s picture

I figured out some more details that might be pertinent to this bug. It seems it only happens when you disable the "Optional" parameter (using an exposed date filter), and then try to set the required (default) "Value" parameter. Even if you type in a correct date, it doesn't validate properly, and thus, the default value isn't stored properly, so visiting the actual views page for the first time throws up an error because it can't get the default value.

Basically, I made this error go away by making the exposed date filter "optional", thereby bypassing the default "Value" option, which may be the source of the problem.

merlinofchaos’s picture

Which date filter? CCK date module?

merlinofchaos’s picture

Oh wait no, that's Views' filter. Thanks for the info, I'll see if I can look into it.

SpikeX’s picture

Oh, yeah, sorry, I'm referring to "Node: Post Date" specifically, though other date filters may have this problem as well, I'm not sure. My issue's been fixed, though, like I said, I just enabled "Optional", so the "Value" parameter wasn't needed (which seemed to be the culprit).

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new601 bytes

Does this help?

merlinofchaos’s picture

Status: Needs review » Fixed

Looks straightforward.

Committed to all branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.