Closed (won't fix)
Project:
Remove Non-viewable Menu Items
Version:
5.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2007 at 11:07 UTC
Updated:
9 Jun 2008 at 22:21 UTC
I installed this module and found that it does not manage show/hide menu items when settings for publish/unpublish are changed in the content list (administer > content management > content). It only shows/hides menu items if the publish setting is set when editing a particular page. When the settings are made on the content list page, the affected page does however become accessible/inaccessible for anonymous users, its just that the menu item remains unchanged.
I've tried it on a few themes and several different pages (created both before and after the module was installed) with the same result.
Comments
Comment #1
gpk commentedThis may be because submitting the administer content page perhaps does not clear the menu cache. Try clearing the cache manually, or submit the modules page to force same.
I guess this module could be modified to cause a menu cache clear on submit of the admin -> content page.
Comment #2
ngroot commentedI agree with gpk. Editing an unrelated menu item (which presumably clears the menu cache) updates the menu; I suspect the menu cache is not being invalidated.
I think this is a bug in the Drupal core, since as you note, updating the publishing status in an individual page's edit screen does update menus as well. I don't know how to work around this reasonably in the module, unfortunately. I don't think I can force the menu cache to clear when the admin→content page is submitted, because my module doesn't own that page. I could invalidate the menu cache on every page load, but that would probably be a nasty performance hit.
I would suggest filing an issue against Drupal core. Sorry!
Comment #3
ngroot commentedUpdate: this seems to already be a known issue. I've submitted a patch.
Comment #4
gpk commented>I don't think I can force the menu cache to clear when the admin→content page is submitted, because my module doesn't own that page
Ahhh I think you can, what about using hook_form_alter() to add a custom submit handler? Though as you say, it looks more like a core bug.
Comment #5
ngroot commentedInteresting idea! I'll keep that in mind for the future. Thanks!
Comment #6
gpk commentedMany/most "interesting" contrib modules are built around hook_form_alter() ... ;)