From 139ef4027ceae2691eb9c5cc2e1f21df44caa145 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 14 May 2005 09:23:47 +0000 Subject: - Patch #22035 by mathias/mikeryan: improved performance of path aliases. --- modules/path/path.module | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/path/path.module') diff --git a/modules/path/path.module b/modules/path/path.module index e1e68e14f..ceedf8cba 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -132,11 +132,11 @@ function path_admin_delete($pid = 0) { function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) { if ($path && !$alias) { db_query("DELETE FROM {url_alias} WHERE src = '%s'", $path); - drupal_rebuild_path_map(); + drupal_clear_path_cache(); } else if (!$path && $alias) { db_query("DELETE FROM {url_alias} WHERE dst = '%s'", $alias); - drupal_rebuild_path_map(); + drupal_clear_path_cache(); } else if ($path && $alias) { $path_count = db_result(db_query("SELECT COUNT(src) FROM {url_alias} WHERE src = '%s'", $path)); @@ -145,7 +145,7 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) { // We have an insert: if ($path_count == 0 && $alias_count == 0) { db_query("INSERT INTO {url_alias} (src, dst) VALUES ('%s', '%s')", $path, $alias); - drupal_rebuild_path_map(); + drupal_clear_path_cache(); } else if ($path_count >= 1 && $alias_count == 0) { if ($pid) { @@ -154,11 +154,11 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) { else { db_query("INSERT INTO {url_alias} (src, dst) VALUES ('%s', '%s')", $path, $alias); } - drupal_rebuild_path_map(); + drupal_clear_path_cache(); } else if ($path_count == 0 && $alias_count == 1) { db_query("UPDATE {url_alias} SET src = '%s' WHERE dst = '%s'", $path, $alias); - drupal_rebuild_path_map(); + drupal_clear_path_cache(); } else if ($path_count == 1 && $alias_count == 1) { // This will delete the path that alias was originally pointing to: -- cgit v1.2.3