Hi nice module, thanks, hopefully it will solve a feature request for me.
However I got the following error when trying to access my Primary Menu admin page:
Fatal error: Unsupported operand types in [...]/drupal/includes/common.inc on line 1546
I was able to resolve this with the help of this webpage:
http://justinhileman.info/articles/unsupported-operand-types-in-drupal-6x
I changed the file menu_item_access.module line 212
from
$form[$mlid]['title']['#value'] = l($item['title'], $item['href'], $item['localized_options']) . ($item['hidden'] ? ' ('. t('disabled') .')' : '');
to
$form[$mlid]['title']['#value'] = l($item['title'], $item['href'], array('attributes' => $item['localized_options'])) . ($item['hidden'] ? ' ('. t('disabled') .')' : '');
Seems to work now but getting the following warning:
warning: preg_match() expects parameter 2 to be string, array given in /var/www/sites/sallyhansen/html/includes/bootstrap.inc on line 761.
Comments
Comment #1
zorp commentedI got the very same error... wonder if there is a conflicting module.
Comment #2
emptyvoid commentedHello,
I don't seem to get this error on my current configuration.
I will research the nature of the operand error, but also I am interested in what other modules you may have installed.
I could setup a similar test environment with your module set and see if a conflict does indeed exist.
What version of PHP are you running?
Thanks,
Comment #3
emptyvoid commentedComment #4
haggins commentedI get the same error after setting menu-item-access permissions.
Apache/2.2.9 (Ubuntu) PHP/5.2.6-2ubuntu4 with Suhosin-Patch
Other access-modules:
node-access
Do you need any more information?
edit:
this works for me:
edit menu_item_access.module
change line 143-147 to
replace line 212 with
Comment #5
haggins commentedas you can see in my last post I needed to expand the query because it only got menu titles of views (titles of node-menu-items seem to be stored only in table menu_link.link.title.
This change affected menu-item listing in the backend. Same is on the frontend where I have a little menu with one view-item and 2 node-item. Only the link to the view is visible because there are no title for the node-menu-items. I think it's the same think with the query around line 1516 but I can not follow the code how/where it generates the links. At this point you have to do the same as above:
I think this is odd because you should have the same issue on you own installation. Something very mysterious is going around here...
Comment #6
agerson commentedWhen I try to acess primery links or secondery links at:
?q=admin/build/menu-customize/primary-links
I get
Fatal error: Unsupported operand types in /Library/WebServer/Documents/drupaldev/includes/common.inc on line 1551
Disabling "Menu Item Access 6.x-1.5" fixed this issue. I would love to be able to use it.
Comment #7
agerson commentedhaggins, unclear on how your fix should be applied here. I tried it with 6.x-1.5 and still got errors. Can you upload a patch file?
Comment #8
haggins commentedsorry agerson, I refused all my changes and uninstalled the module. I got everything what I need working with menu admin per role module.
My patch refers not to the first error but to the warning you get when applying the changes of #1.
"Seems to work now but getting the following warning:
warning: preg_match() expects parameter 2 to be string, array given in /var/www/sites/sallyhansen/html/includes/bootstrap.inc on line 761."
Comment #9
emptyvoid commentedIssue fixed with new release.