Active
Project:
Path redirect
Version:
6.x-1.0-rc2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2011 at 12:49 UTC
Updated:
13 Oct 2011 at 17:53 UTC
I've had a problem with cache_page being cleared every time a node edit page is loaded, regardless wether it is saved or not. Tracked it down to pathauto.module _pathauto_alias_exists(), which is called when a node edit form is loaded, calling path_redirect_delete_multiple() if the path_redirect.module exists.
function path_redirect_delete_multiple($rids = NULL, $conditions = array()) {
$query = array();
_path_redirect_build_conditions($query, $rids, $conditions);
$sql = 'DELETE FROM {path_redirect} WHERE ' . implode(' AND ', $query['conditions']);
db_query($sql, $query['args']);
$deleted = db_affected_rows();
path_redirect_clear_cache();
return $deleted;
}
In the function as it stands, path_redirect_clear_cache() is called whether or not anything is deleted. I wonder whether a simple condition could be added to only clear the cache if $deleted is non-zero?
$deleted = db_affected_rows();
if ($deleted) {
path_redirect_clear_cache();
}
| Comment | File | Size | Author |
|---|---|---|---|
| path_redirect.clear_cache.patch | 511 bytes | joe-b |
Comments
Comment #1
revnoah commentedI have a related issue. Subscribing.
Comment #1.0
revnoah commentedreformatting the code segments