Taxonomy_menu'ed term's menu item loses hierarchy when term is edited in TaxMan

Created on 27 June 2014, about 11 years ago
Updated 27 June 2025, about 2 months ago

When editing and saving a child term (e.g it's name or some field) via Taxonomy Manager, and the term is in a vocabulary that's synced into a menu via the taxonomy_menu.module, that term's menu item is thrown out its hierarchy onto the top level of the synced menu.

Similar problems have been long reported in the issue queues of both modules for different versions, such as:

* https://www.drupal.org/node/742660
* https://www.drupal.org/node/837954
* https://www.drupal.org/node/980716

The problem still seems to exist, and the reason is that taxonomy_manager_term_data_form_submit() structures the parents information for that edited term in a way ($term->parents with fancy substructures) that's incompatible to how taxonomy prepares the parent information of its edited/saved terms (i.e. $term->parent (without an 's') as a simple array of tids) and to what taxonomy_menu expects structure-wise ($parents as a simple array of tids). Phew, what a mess.

The simple patch below against taxonomy_manager_7.x-1.0 should fix that particular problem.

Please test and give feedback, or commit if tested.

🐛 Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇩🇪Germany danielnolde

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024