The menu structure generated by the module at /sitemap cannot be modified at all. This makes it impossible for other modules to jump in.
For example, Special Menu Items adds two new tokens on top of ( and ). Adding a hook would enable this module or a glue module to avoid these entries to generate a non existent link.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1349202_add_hook_sitemap_menu_tree_alter_3.patch | 538 bytes | juampynr |
| #2 | 1349202_add_hook_sitemap_menu_tree_alter_2.patch | 638 bytes | juampynr |
| #1 | 1349202_add_hook_sitemap_menu_tree_alter.patch | 638 bytes | juampynr |
Comments
Comment #1
juampynr commentedAttaching patch to be reviewed.
Here is an example of how Special Menu Items could make links to <nolink> to point to the sitemap page:
Comment #2
juampynr commentedAttaching an improved patch with right paths in the diff.
Comment #3
juampynr commentedSorry, uploaded the same one. Here it is.
Comment #4
darrell_ulm commentedLooks interesting.
Hey offhand, can anyone tell me if there are possible security implications for this?
Just checking.
Comment #5
juampynr commentedHere is the related issue on Special Menu Items: #1104940: filter out Special menu items from xml sitemap.
The risk of adding a hook would depend entirely on what the module that hooks in does, but it does not add any security breach by itself. However, I have added the tag Needs Sec Review to this issue.
Comment #6
webadpro commentedHas this been commited yet?
Comment #7
juampynr commentedNo.
Comment #8
arpieb commentedMissed this issue in my search - a more complete and Drupal-standard way to invoke the alter implemented in the patch in #1588988: Add alter hook for menu tree prior to rendering.
Comment #9
darrell_ulm commentedBased on http://drupal.org/node/1349202#comment-6030258 closing out due to duplicate patch at http://drupal.org/node/1588988.