diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-03-26 20:44:10 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-03-26 20:44:10 +0000 |
commit | 16c5713bc03855361349dc913e9d3e3bf23298c3 (patch) | |
tree | 6afbea38989713785dadcf14385c6eea38798b44 /modules/system | |
parent | 1c6df63309bbb6327100dba50239bd9192e06d7f (diff) | |
download | brdo-16c5713bc03855361349dc913e9d3e3bf23298c3.tar.gz brdo-16c5713bc03855361349dc913e9d3e3bf23298c3.tar.bz2 |
- Patch #241013 by Pedro Lozano, drewish, andypost, mr.baileys: actions only trigger one action per node page load.
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.module | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index a8e57d924..bea366815 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2097,6 +2097,10 @@ function system_get_files_database(&$files, $type) { */ function system_update_files_database(&$files, $type) { $result = db_query("SELECT * FROM {system} WHERE type = :type", array(':type' => $type)); + + // Remember if any module or theme is moved to a new filename so we can + // clear the system_list cache (in particular, the 'filepaths' subarray). + $filename_changed = FALSE; // Add all files that need to be deleted to a DatabaseCondition. $delete = db_or(); @@ -2127,6 +2131,10 @@ function system_update_files_database(&$files, $type) { ->fields($updated_fields) ->condition('filename', $old_filename) ->execute(); + + if (isset($updated_fields['filename'])) { + $filename_changed = TRUE; + } } // Indicate that the file exists already. @@ -2135,6 +2143,7 @@ function system_update_files_database(&$files, $type) { else { // File is not found in file system, so delete record from the system table. $delete->condition('filename', $file->filename); + $filename_changed = TRUE; } } @@ -2165,6 +2174,13 @@ function system_update_files_database(&$files, $type) { } } $query->execute(); + + // If any module or theme was moved to a new location, we need to reset the + // system_list cache or we will continue to load the old copy, look for DB + // schema updates in the wrong place, etc. + if ($filename_changed) { + system_list_reset(); + } } /** |