I just upgraded my site to 6.x-2.8 and I'm suddenly getting a WSOD on the frontend. The backend still works. When turning on error reporting, I get this:

Fatal error: Cannot redeclare class views_handler_argument in /[...]/sites/all/modules/views/handlers/views_handler_argument.inc on line 0

I also tried rolling back the changes, but I'm still getting the error for some reason I don't understand. The only thing that makes it go away is deactivating views.

What could be the reason for this? This site has been running for years, everything is at the last version. It's okay for now without views, but this isn't really a solution in the long term.

Comments

merlinofchaos’s picture

Status: Active » Fixed

Usually that kind of error message will say where it was originally declared and where it was being newly declared. The message you quoted doesn't seem to have all of that.

When you get this kind of error it usually means that there are somehow multiple copies of Views or that the file it is referencing somehow got incorrectly installed. You should look at the file. ARe there two instances of "class views_handler_argument"? If so something got messed up.

One quick thing to check is to make sure you didn't accidentally but Views in two places in your tree. It's common to have modules/views and sites/all/modules/views and this will result in breakage. It's also been known to happen that it will accidentally get moved into another directory. I saw one instances of /modules/node/views alongside /modules/views.

Another thing to check is that sometimes APC can cause errors like this when it doesn't notices that files were modified. One solution might be to completely delete your views directory and unpack from tarball. (You should do this anyway when upgrading, to make sure that files that no longer exist get properly removed).

Finally, if none of the above works, try grep "class views_handler_argument" * in the views directory to see if that turns up more than one result.

One of the above should fix the issue. Given that nobody else has reported this yet, I feel confident that there is some kind of installation problem causing this, because nobody would be able to use Views if it were actually going out like this.

eagereyes’s picture

Thank you, deleting and re-unpacking views did it. So simple. I haven't dealt with problems in Drupal much, so I'm a bit lost when something like this happens. I'll have to make the rm -rf of the module dir part of my update routine. And I'll bookmark your list of suggestions for the next time this happens.

BTW, I did not see a message telling me where it had been declared previously. It's also a bit weird that it shows line 0 as the offending one, which doesn't declare anything.

merlinofchaos’s picture

That line 0 thing really makes me think it was APC not clearing its cache. That's annoying.

crosputni’s picture

I have the same issue. Working through your possible resolutions now, but so far, no luck. :(

crosputni’s picture

Yeah I am unable to get the front end of my site to work with the most recent version. I had to revert back to the older version and use my database backup... never thought I'd need that, but I guess it's good I continue to backup every time I update.

markus_petrux’s picture

Maybe related to an APC option such as apc.apc.stat = 0?

Status: Fixed » Closed (fixed)

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

thommyboy’s picture

Status: Closed (fixed) » Active

Hi, I get the same behaviour after updating from 2.6 to 2.8. Backend works fine, after logging out, the frontend does not show up (we use our own frontend theme) and we get a white screen. We don't have duplicates of Views installed.
We found out that after setting to a standard theme in settings.php the frontend works- any idea?

thommyboy’s picture

Some more testing, checked the error.log and got a
PHP Fatal error: Unsupported operand types in /var/www/sites/MYSITE/htdocs/sites/all/modules/views/handlers/views_handler_field.inc on line 460

I checked the script and changed line 460 from
$alter = $item + $this->options['alter'];
to
$alter = $item . $this->options['alter'];

And everything works fine. Is this a bug or just something special in my configuration?!

dawehner’s picture

Thommboy. This cannot work by default. $this->options['alter'] is an array, so as $item. The operator is right.

Have a look at this example code

$arr1 = array(2, 3, 4);
$arr2 = array(5,6,7);
dsm($arr1 + $arr2);
dsm($arr1 . $arr2);
thommyboy’s picture

hi dereine, thanks for your answer.

i echoed $item and $this->options['alter']. $item is a string and doing "$item + $this->options['alter']" does not work.
so either $item should be an array like you say or the operator doesn't fit.
But I think "foreach ($raw_items as $count => $item)" doesn't make $item an array...

thommyboy’s picture

i still have the same problems. tried 3.0alpha2 and now i get the same fatal error in line 468. i out-commented this line and put in "echo "item:" . $item . " options:" . $this->options['alter']; " what i get is

"item:Beratung und Service options:Arrayitem:Beratung und Service options:Arrayitem:Ausrüstung und Produkte options:Array..."

so $item is a string and cannot be "+" with an array. the values echoed in $item are terms of my taxonomy. and i get this output no matter what page I call- even if I call "/user" where the terms aren't displayed. Any idea what could be wrong?

thommyboy’s picture

ok, i found the problem. i var_dump'ed $this and saw that the module views taxonomy translation of i18n seems to cause the problem. when this module is installed, $item becomes a string rather than an array and causes the php fatal error because a string can't be "+" with an array...

thommyboy’s picture

Status: Active » Closed (fixed)