Download & Extend

code in menu.inc throws fatal error when triggered.

Project:Drupal core
Version:5.16
Component:menu system
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

Greetings,

We ran into an issue the other day. One of the users for our site created a new page, but when he went to view the page, he got a 500 server errror. Personally, I got a blank page, which suggested in my mind a fatal PHP error.

So, I enabled logging of PHP errors, and this is what I found in the log:

[07-Mar-2009 22:41:50] PHP Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /hsphere/local/home/****/****/includes/menu.inc on line 356

I did some digging in the that inc file. This is the offending line:

      $item['type'] |= MENU_VISIBLE_IN_BREADCRUMB;

Commenting out that line seems to be an adequate, if undesirable, workaround. At this point, I'm beyond my understanding of PHP to actually say what the problem is, so I cannot fix it. It was only one node that fatally errored out as a result of this, and after going over the submitted data with a fine toothed comb, I couldn't say what was different in that post that isn't in other posts.

We are currently running Drupal version 5.16

Comments

#1

I have the same problem/error on an upgraded site, Drupal version 5.16

The problem occurs without relation to the actual content of the node.
That is: Creating a node sometimes results in a blank screen and the above error (thus on viewing the created node) and then creating a new node with exactly the same content again produces a node that is ok, no crash, no error message.

The strange thing that sometimes simply adding a taxonomy item to the node makes the error disappear.

But the error seems to be persistent on all other changes to the content. I then simply have to delete the node and start all over again.

#2

Same issue here - When I assign some taxonomy terms to some nodes (don't ask why) I get that error.
Then removing the term fixes the problem.
I have taxonomy menu installed and I'm afraid thats actually causing this problem...

#3

Interesting.. that line of code has been that way since 2004. What version of PHP is everyone using?

#4

I'm having the same problem, and also have the Taxonomy Menu module installed.

My PHP version info: PHP 5.1.2 (cli) (built: May 18 2006 05:05:09).

#5

From what I can find online about that error... it is often cause by using an assignment operator in an invalid context. Probably the most common reason is something like:

<?php

$a
= new Array('this', 'is', 'an', 'array');
$a .= 'but it will throw this error when trying to concatenate text to it';
?>

I don't think there is much possibility that $item['type'] is an array at this point. Following the generation path, I don't see any place where this variable can be changed to anything but a a set of bitwise flags.

Is there any way you can post the exact steps you take to trigger this error? Also, exact PHP version & host would help.

#6

PHP Version 5.2.4 on Apache
Build Sep 27 2007 01:50:00

#7

sorry for not following up on this. PHP 5.2.9

#8

brianV, i wish i could, unfortunately it's been so long i can't remember where the error cropped up on our site

#9

I also had this problem. It occurred when I ran cron and re-indexed the site's content. I had node expire module running, which unpublished some of my content. Then, when I tried to view the unpublished content, I got the error mentioned above.

However, disabling taxonomy menu makes the error go away.

#10

Status:active» postponed (maintainer needs more info)

freatida was it exactly that error? Can you paste it? jdmoser can no longer reproduce his error and I want to be sure you have the same exact issue.

#11

It was exactly the same error message, yes.

What I did:
- I ran cron.php and re-indexed the site
- node expire module unpublished a load of nodes
- when I tried to view them, I got the error
- If I manually re-published them, I still got the error
- if I manually un-published a published node and then viewed it I didn't get the error
- disabling taxonomy menu made the error go away

#12

Hi there,

I had the same problem in my website, www.kharidgar.com. I traced teh problem and find out that it comes from taxonomy_menu module.
When you set this module to hide empty terms it does not create any menu item for empty terms, but when you try to add a new node to one of these empty terms, the module assumes that all terms are registered in menu system and it results in problem.

To fix this problem you have 2 choices:
1- Set taxonomy_menu to display empty terms as well.
2- or visit admin/build/menu after submitting a new node that makes this error message.

So I guess this is a bug in taxonomy_menu or maybe some other modules that call menu_set_location function.

#13

I saw this error on a client's site today, and the circumstances and behavior were as has been previously described. We have taxonomy menu module in full effect and they were adding content to sections (categories) which had been eliminated from the menu because the module is set to not display empty terms. The categories were emptied via scheduled unpublishing (although in this case through the Schedule module, rather than Node Expire). I'd like someone who works on the taxonomy menu module to try to recreate this error and find a fix.

#14

sub

#15

Hi all,

In my case this error was related to an update to the pathauto module. I needed to change my settings for a certaint content-type to use the title-raw token instead of [title], and make sure my hyphens were set to be replaced by my seperator becuase I was using hyphens as a seperator. I'm not sure which of these individual steps fixed the problem, but there it is.

I suspect a lot of the time this error could be related to a module that does things to the url aliases or breadcrumb - that is certainly the case with the taxonomy menu module as well.

#16

Status:postponed (maintainer needs more info)» closed (won't fix)

I guess this is a won't fix since Drupal 5 is no longer supported.

nobody click here