Override processing at admin/content/taxonomy to trigger lineage_update_all()

xjm - October 24, 2009 - 09:00
Project:Taxonomy Lineage
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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().

#1

xjm - October 24, 2009 - 14:44

Perhaps with lineage_form_taxonomy_overview_terms_alter().

#2

xjm - October 24, 2009 - 19:29
Status:active» needs review

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.

AttachmentSize
lineage_6_1-613372-2.patch 1.73 KB

#3

xjm - October 25, 2009 - 13:30
Title:"Reset to alphabetical" should trigger lineage_update_all()» Override processing at admin/content/taxonomy to trigger lineage_update_all()

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.

AttachmentSize
lineage_6_1-613372-3.patch 5.67 KB

#4

Justin W Freeman - November 15, 2009 - 05:21
Status:needs review» fixed

Committed

#5

System Message - November 29, 2009 - 05:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.