Closed (fixed)
Project:
Administration menu
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Jun 2009 at 11:34 UTC
Updated:
20 Jul 2009 at 21:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
sunMoving to Ubercart for now. I don't know whether UC did something special to add its items to admin_menu. 3.x-dev has been completely rewritten to re-use the regular menu system.
Comment #2
rszrama commentedHmm... not sure... nothing in Ubercart is operating outside of the normal menu system. : ?
Comment #3
Island Usurper commentedNo, Ubercart uses the regular menu system, too. About the only thing that needed to be done as far as special handling was to rebuild the admin_menu structure when Ubercart was installed back in the 2.x branch. Other than that, it's always "just worked".
I think I found the problem, though. MENU_NORMAL_ITEM is the default type for a menu item. However, admin_menu_menu_alter() doesn't treat an unspecified type like MENU_NORMAL_ITEM. All of Drupal core, and probably most of contrib, doesn't specify a type, so they get
'menu_name' = 'admin_menu'. I've always specified the type, but MENU_NORMAL_ITEM gets treated like MENU_CALLBACK, which doesn't have its menu name changed.Assuming that all MENU_NORMAL_ITEMs under "admin/" should be in the admin_menu, this patch should work.
Comment #4
jurgenhaasConfirmed, that patch works.
Comment #5
sunComment #6
sunI see. That means we have to cater for some additional menu item types, because hook_menu_alter() gets the unprocessed registry information of all hook_menu() implementations.
Comment #7
sunThanks for reporting, reviewing, and testing! Committed attached patch implementing a proper fix to all 3.x branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
@Island Usurper: You could save a fair amount of code lines if you'd just remove those MENU_NORMAL_ITEM definitions, because it's the default value for menu items. Additionally, I highly suggest to enable E^ALL error reporting in PHP -- I get a _bloat_ of PHP notices with Ubercart core modules enabled. Yes, you can hide them, but every single PHP notice slows down the system a bit.
Comment #9
dave reidBTW this has caused a regression and makes the /admin page not work correctly at all. See #511744: /admin page links are broken with latest development snapshot.