This module uses a form_alter to take over which menu items are included in the admin screen. However, it does not prevent unneeded items from loading from the initial query in menu_overview_form(). This is because form_alter functions only run after the heavy loading has already happened in the initial form function.
This patch uses a menu_alter instead to prevent menu_overview_form() from ever being called. Instead a modified version, menuadminsplitter_overview_form() is called and it's base query is aware of the depth and menu item limits.
Also, this patch gets rid the use of user objects. I don't see a need for per user defaults. And this module certainly should not do a user_save() in hook_init() on every single page load for admin users.
I'll post the patch shortly.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | menuadminsplitter-rewrite-1597292-2.patch | 13.15 KB | stevector |
| #1 | menuadminsplitter-rewrite-1597292-1.patch | 12.9 KB | stevector |
Comments
Comment #1
stevectorComment #2
stevectorHere's an updated patch that adds comments, coding style fixes, @todos, etc.
I've also emailed with TomiMikola and he has added me as a maintainer. Barring any objections, I'll commit this patch within a day or two. Because this module is still in dev, I feel it is less critical to get a change like this reviewed prior to committing. If the module had a full release, I would be much more hesitant.
Comment #3
stevectorI have committed #2.