Needs work
Project:
XML sitemap
Version:
7.x-2.x-dev
Component:
xmlsitemap_menu.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Dec 2010 at 03:15 UTC
Updated:
3 Jul 2019 at 13:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tsvenson commentedDid some more testing and it is not even possible to manually change an individual menu link to included. It is automatically reverted back to "Default (excluded)".
Upping priority to critical since module simply don't work at all with this bug.
Comment #2
dave reidThat's not exactly the definition of a critical bug. Downgrading to major.
Comment #3
tsvenson commentedNo problem, I thought it was to be seen as critical since the submodule in practice is completely broken as it is now.
Comment #4
dave reidConfirmed the bug with altering XML sitemap settings for a menu. The menu link bug seems to as a result of #1013856: hook_menu_link_update() not invoked for menu links that have other elements form_alter()'d in.
Comment #5
dave reidOk I think I worked around the core bug and double checked I could edit status and priority for both menus and menu links.
http://drupal.org/cvs?commit=473566
Comment #7
catchSorry to re-open this, but I tracked this commit down for a performance regression in menu_rebuild().
If you trigger a _menu_navigation_links_rebuild(), the array_intersect_assoc() in menu_link_save() prevents it from re-saving every menu link each time. Moving this to hook_menu_link_alter() from hook_menu_link_update() means that this code now runs whether the link is updated or not.
This took a menu_rebuild() on one Drupal 7 installation I'm profiling from less than one second to around six seconds.
Attaching webgrind screenshot to show the issue.
I'm wondering if it'd be possible to workaround the core bug by adding an extra #submit to the form alter rather than hook_menu_link_alter(), but it's late here so just posting the issue for now.
Comment #8
catchAlso cross linking #1034732: API additions: menu_link_load_multiple() and menu_link_delete_multiple() - looks like that would help here in general, although would be great to avoid it in the rebuild case entirely of course.
Comment #9
catchThis just adds checks to make sure we don't operate on links where module is system, that aren't customized. Fixes the 5 second regression for me.
I'm still seeing this run on hook_menu_link_insert(), if that turns out to be fixable in xmlsitemap will post a separate patch for that.
Comment #10
catchNo syntax error this time.
Comment #11
catchLooked at this some more and discussed with Jacob Singh. Looking through the xmlsitemap_menu some more, it appears that even for module-defined links that aren't customized, this logic may still need to run (but only when an item is actually updated or inserted, not on every call to menu_link_save()).
A better workaround might be to add a #submit to the menu item form - that would then handle the updates not triggering, but without affecting menu_rebuild().
I noticed that on a menu_rebuild() that actually saved 53 links, this logic still took over 900ms, so would be good to optimize it independently - for example letting the process function take an array of links rather than just mlids, saving the menu_link_load().
For now I'm posting a revert, it looks like xmlsitemap_cron() may add these links eventually anyway.
Comment #12
dave reidThe cron hook won't pick up links that have already been indexed. So this would cause a regression in the original bug.
Comment #13
katbailey commentedPardon the noise but I needed a reroll of this patch for drush make purposes...
Comment #14
Anonymous (not verified) commentedOh testbot here you go.
Comment #16
dave reidIssue in #12 has not been addressed yet.
Comment #17
lnunesbrUpdated patch to make it compatible with current 7.x-2.x-dev