From 39cb3cbf36a37e933e888486b8b9810b7aeac972 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Garcia Date: Fri, 4 Mar 2011 09:11:22 -0600 Subject: [PATCH] changes to keep url aliases on hirearchy changes --- taxonomy_manager.admin.inc | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/taxonomy_manager.admin.inc b/taxonomy_manager.admin.inc index 412f379..83b0da3 100644 --- a/taxonomy_manager.admin.inc +++ b/taxonomy_manager.admin.inc @@ -2083,6 +2083,7 @@ function taxonomy_manager_delete_terms($tids, $options = array()) { */ function taxonomy_manager_move($parents, $children, $options = array()) { if (!is_array($parents)) array($parents); + $srcs = array(); foreach ($children as $child) { if (!$options['keep_old_parents']) { @@ -2092,7 +2093,14 @@ function taxonomy_manager_move($parents, $children, $options = array()) { db_query("DELETE FROM {term_hierarchy} WHERE parent = %d AND tid = %d", $parent, $child); //prevent duplicated sql errors db_query("INSERT INTO {term_hierarchy} (parent, tid) VALUES (%d, %d)", $parent, $child); } + $srcs[] = sprintf("taxonomy/term/%d", $child); } + + if(module_exists('pathauto')){ + db_query('delete from url_alias where src in('.db_placeholders($srcs, 'varchar') .')',$srcs); + _pathauto_include(); + taxonomy_pathauto_bulkupdate(); + } } /** -- 1.7.4.1