Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The other options for each link work fine but adding a custom class to my home button gives me:
Fatal error: [] operator not supported for strings in ...includes/common.inc on line 2277
When I am on the front page when the menu is ready to load. That line in common.inc seems to add the "active" class to that link causing a conflict:
$options['attributes']['class'][] = 'active';
I tried to see if the dev version fixed the issue but no luck
Comments
Comment #1
Dave ReidI can't duplicate this with the latest Drupal core. It looks like there was patch that went in with #283723: Make menu_tree_output() return renderable output on Sept 18 2009 that addressed this.
Comment #2
nadavoid CreditAttribution: nadavoid commentedI am also seeing this error.
Using Drupal 7 RC1 and menu_attributes 7.x-1.0-beta1. PHP 5.2.12.
The error message points to line 2284 in common.inc now. A little more context:
It only happens if I'm on a page (home page, in my case) that causes a menu item to be designated as "active". If that menu item also has a custom class added by the menu_attributes module, I get the reported fatal error.
Comment #3
Dave ReidPlease try re-saving your menu item with the latest 7.x-1.x-dev. There was a fix that went in to convert classes to an array on save, which should fix this issue.
Comment #4
nadavoid CreditAttribution: nadavoid commentedThat fixed the issue for me. I added a class back in and resaved the menu item. It appears in the markup without error now! Thanks Dave!
Comment #5
robato CreditAttribution: robato commentedThis also fixed the issue for me as well. However, it took me a good 20 minutes to find the 7.x-1.x-dev file to overwrite the beta version. Is there a way you can add the dev version to the http://drupal.org/project/menu_attributes
Im sorry if I sound like a moron for making such a request, I dont know how the drupal development system works.
Comment #6
Dave ReidI enabled the dev release, although I'll likely be creating new releases today anyway.
Comment #7
Dave ReidComment #9
prnorth CreditAttribution: prnorth commentedI just updated a Drupal 6 site to Drupal 7 today after several failed attemps and have run into this error. I/'ve spent most of today trying to figure it out.
This is the error I get:
Fatal error: [] operator not supported for strings in /homepages/24/d255011919/htdocs/includes/common.inc on line 2487
and it appears to relate to this line in common.inc