Currently, if one uses the "Reset to alphabetical" option at admin/content/taxonomy/#, the lineages are not updated and therefore end up being entirely wrong. This action needs to trigger lineage_update_all().

I'm not quite sure how to go about fixing this bug, as "Reset to alphabetical" doesn't trigger hook_taxonomy().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm’s picture

Perhaps with lineage_form_taxonomy_overview_terms_alter().

xjm’s picture

Status: Active » Needs review
FileSize
1.73 KB

Here's a patch to override the form action following the "Reset to alphabetical" confirmation so that we can run lineage_update_all() after the vocabulary weights have been set. I also added an optional vid to lineage_update_all() so we can act only on the affected rows.

Tested and seems to work fine on my sandbox.

xjm’s picture

Title: "Reset to alphabetical" should trigger lineage_update_all() » Override processing at admin/content/taxonomy to trigger lineage_update_all()
FileSize
5.67 KB

Here's a better patch. The original was fewer lines, but interrupted the normal flow of form processing, whereas this one simply overrides the whole submit handler. It will be easier to maintain and also allows lineage_update_all to be called just once after the reordering form has been processed (to ensure the correct lineages for all terms).

Applied and tested; works fine.

Agileware’s picture

Status: Needs review » Fixed

Committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.