Problem/Motivation
Because of the latest commit in https://www.drupal.org/project/taxonomy_menu/issues/3408881 I am not able to simply disable a menu link from UI, unless its related taxonomy term is unpublished. But I do not want to unpublish the term itself as I do have multiple taxonomy menus built on the same vocabulary, and some links have to be published under one menu but not the other.
Steps to reproduce
Proposed resolution
Traced the bug to that recent commit where in isActive() function we rely solely on taxonomy term status without taking into consideration the choice made on Menu Link UI (to disable/enable it).
Attaching a patch to modify the recent commit to only return the link status based on taxonomy term status as "inactive" if the term is unpublished. Otherwise, it should return the status selected for the link itself.
Issue fork taxonomy_menu-3505347
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
veronicaseveryn commentedComment #3
znerol commentedThis affects us as well.
Comment #4
znerol commentedThe patch could be simplified a bit. The following one line change does the job as well:
Ultimately this is a question of coding style. I do not have any preference on how the issue is resolved.
Comment #5
mighty_webberWe are also experiencing this. The provided patch resolves the issue.
Comment #6
damienmckennaI'm sorry that the other bug fix introduced this bug.
Let's expand the test coverage to make sure this doesn't come back to haunt us again.
Comment #7
jannakha commented@veronicaseveryn thanks for patch!
+1 for patch #2
changing priority to critical
Comment #8
alexander tallqvist commentedCan confirm that the patch #2 fixed the issue for us as well.
Comment #9
znerol commentedWorking on tests.
Comment #11
znerol commentedPushed a test which passes with the fix and fails without.
Comment #12
znerol commentedComment #13
jannakha commentedthanks for you contribution!
Tested MR16 - looks good.
Screenshot before patch:


Screenshot after patch:
Comment #14
trickfun commentedPatch works fine!
Thank you
Comment #15
savage1974 commentedPatch works.
Thanks a lot!
Nuances:
1. The patch also allows you to change the menu structure (for example, items of level 2 display as items of level 1)
2. After adding a new item to the taxonomy and saving it, the menu structure doesn't change.
PS drupal 11.1.7 (drupal cms), module - Taxonomy Menu 8.x-3.7
Comment #16
chikeThe patch works.
Thanks.
Comment #17
batigolixI also confirm that the changes introduced in the merge request solve the problem
Comment #18
vinodhini.e commentedHi, Steps to reproduce
Installed the Taxonomy Menu module on Drupal 11.2.x.
Created a vocabulary and added terms.
Built a menu from the vocabulary.
Tried to disable a menu link from the Menu UI while keeping the related taxonomy term published.
Issue: The menu link could not be disabled unless the taxonomy term itself was unpublished.
After applying Merge Request #16
Able to disable the specific menu link directly from the Menu UI.
Functionality is working fine as expected. ✅
Thanks!
Comment #20
damienmckennaThis has been committed, thanks everyone.