Adding a functionality to allow hiding unpublished/disabled taxonomy terms from menus would be great.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 3408881-22.patch | 834 bytes | marios anagnostopoulos |
| #7 | 3408881-7.patch | 1.06 KB | g-brodiei |
| #7 | new-patch-linkset.gif | 628.68 KB | g-brodiei |
| #7 | old-patch-linkset.gif | 805.32 KB | g-brodiei |
| #6 | After Patch.png | 45.37 KB | sandeep_k |
Issue fork taxonomy_menu-3408881
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 #3
makbay commentedComment #4
marios anagnostopoulos commentedAttaching a patch for the existing MR.
I have tested this and it works as expected. Needs CR for changes to appear, but I guess that is the way pretty much everything works with menu items.
However, I would prefer if the whole operation would take place during the link definition creation/update in
generateTaxonomyMenuEntriesandupdateTaxonomyMenuEntries. The caveat there is that I don't see a good way to show/hide per language.IDK is there any issue about having different enabled status per language for menu links?
Comment #5
emberhood commentedAttaching a patch adding respect of parent enable check of term link.
This is considered needed in case of conflict with work done in other places like this one: https://www.drupal.org/files/issues/2023-10-13/taxonomy_menu-hide_empty_...
Comment #6
sandeep_k commentedHi, I've Tested MR- MR !9 mergeable on Drupal version- 10.1.9-dev. The MR was applied successfully and looks good to me.
Testing Steps:
Testing Results:
After applying the patch, the Unpublished terms are not showing now.
Comment #7
g-brodieiHi, we've met the same issue on a use case to render a taxonomy menu by linkset feature.
We're using Drupal 10.2.5, taxonomy_menu 3.6
The test in merge request does not update the menu item shown in linkset endpoint, please see the gif below where I'd unpublished the term.
Steps with old patch:
I've figured out another fix that successfully updates the menu item's "enabled" property while also affects linkset endpoint.
Steps with new patch:
Comment #8
damienmckennaWe definitely want to get this in the next release.
Can someone please update the MR to include the latest changes in the 8.x-3.x branch?
Also, this needs test coverage to make sure the change isn't accidentally broken later on.
Thank you.
Comment #10
dlevchik commentedMR updated: Added most recent commits from 8.x-3.x, created test case for unpublished taxonomy term
Comment #12
damienmckennaGreat work, thank you!
Committed.
Comment #13
damienmckennaComment #14
damienmckennaComment #15
damienmckennaComment #16
damienmckennaFYI after discussing it with the security team it was decided that this fit under PSA-2023-07-12. In short, while there is a security aspect to this, it is such an unlikely scenario to happen that it was deemed fixable in public. As such, there won't be an advisory for this fix.
Comment #17
szeidler commentedThe change has caused a big regression for us on translatable vocabularies. Now every taxonomy menu item is shown twice.Sorry, it seems to have been a problem with our particular setup, that just became visible now with the update.
Comment #18
damienmckennaThank you for the clarification, szediler.
Comment #19
karlsheaNot all of the patch changes made it in, so it's not possible to get or alter the enabled item. I'll open a new issue.
Comment #21
marios anagnostopoulos commentedThe parent support introduced in #5 seems to be missing.
Is there any specific reason this was omitted?
Comment #22
marios anagnostopoulos commentedAttaching a patch to the current version with the change mentioned in #5 about respecting parent Plugin enabled status
Comment #23
marios anagnostopoulos commentedEDIT: IDK if I should reopen the issue or create a followup or wait for feedback
Comment #24
batigolix@marios anagnostopoulos : this issue is already closed, so yes: please make a new issue for this.