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

gpk’s picture

This 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.

ngroot’s picture

Status: Active » Closed (won't fix)

I 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!

ngroot’s picture

Update: this seems to already be a known issue. I've submitted a patch.

gpk’s picture

>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.

ngroot’s picture

Interesting idea! I'll keep that in mind for the future. Thanks!

gpk’s picture

Many/most "interesting" contrib modules are built around hook_form_alter() ... ;)