Problem/Motivation

Prior to 7.x-2.1, hidden menu items used to be considered by Menu Trail By Path. This issue has been addressed on Hidden menu links should be ignored and been committed and resolved.

I agree that they should be ignored, but for backwards compatibility, and to support edge cases where the site does want them to be shown (eg. on our site we are using it to show Organic Groups pages on OG specific menus), I propose we add an option to show the hidden menu items.

Proposed resolution

To add an option to the Menu Trail By Path admin page to show hidden menu items. The checkbox will say ' Include disabled menu links'. See attached screenshot.

Patch attached.

Comments

victoriachan created an issue. See original summary.

victoriachan’s picture

davy-r’s picture

Status: Active » Needs work
Issue tags: +Needs tests

Looks good, could you add a test to complete this issue?

victoriachan’s picture

Thanks for reviewing this, davy-r. I'm not quite sure how to add a test for this.

Did you mean updating the simpletest in menu_trail_by_path.test or do you mean just to run the automated test on the patch?

I tried to look into the simpletest, but somehow when running it on my build (using un-patched menu_trail_by_path 3.0), it already has quite a few fails and exceptions, so I'm not sure how to proceed.

Cheers,
Victoria

davy-r’s picture

Yes, please add at least one test, to "menu_trail_by_path.test", which proves that this new feature works (and will continue to work in future releases).

All tests will pass in a clean environment, see https://www.drupal.org/node/741036/qa

Thanks!

jmcpolin’s picture

This worked perfect for me so thank you. However when I updated the module from 7.x-3.2 to the latest 7.x-3.3, I cannot apply the patch. Can anyone help? Thanks in advance!