From ee700371aca60269b9c752d1e143cae64d18a745 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 20 Dec 2008 05:20:21 +0000 Subject: [PATCH] - Patch #319404 by Dave Reid: simplify actions_sychronize and remove paramater. --- includes/actions.inc | 11 +++++++---- modules/system/system.module | 4 ++-- modules/trigger/trigger.install | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/includes/actions.inc b/includes/actions.inc index 98b9b8eae51..f18f54c5c66 100644 --- a/includes/actions.inc +++ b/includes/actions.inc @@ -245,11 +245,14 @@ function actions_function_lookup($hash) { * the actions table. This is necessary so that actions that do not require * configuration can receive action IDs. This is not necessarily the best * approach, but it is the most straightforward. + * + * @param $delete_orphans + * Boolean if TRUE, any actions that exist in the database but are no longer + * found in the code (for example, because the module that provides them has + * been disabled) will be deleted. */ -function actions_synchronize($actions_in_code = array(), $delete_orphans = FALSE) { - if (!$actions_in_code) { - $actions_in_code = actions_list(TRUE); - } +function actions_synchronize($delete_orphans = FALSE) { + $actions_in_code = actions_list(TRUE); $actions_in_db = db_query("SELECT aid, callback, description FROM {actions} WHERE parameters = ''")->fetchAllAssoc('callback', PDO::FETCH_ASSOC); // Go through all the actions provided by modules. diff --git a/modules/system/system.module b/modules/system/system.module index ad56aea3789..3e77dde00ff 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1607,8 +1607,8 @@ function system_action_info() { */ function system_actions_manage() { $output = ''; + actions_synchronize(); $actions = actions_list(); - actions_synchronize($actions); $actions_map = actions_actions_map($actions); $options = array(t('Choose an advanced action')); $unconfigurable = array(); @@ -1862,7 +1862,7 @@ function system_action_delete_orphans_post($orphaned) { * Remove actions that are in the database but not supported by any enabled module. */ function system_actions_remove_orphans() { - actions_synchronize(actions_list(), TRUE); + actions_synchronize(TRUE); drupal_goto('admin/settings/actions/manage'); } diff --git a/modules/trigger/trigger.install b/modules/trigger/trigger.install index 03c8585bfc5..c6bb061b096 100644 --- a/modules/trigger/trigger.install +++ b/modules/trigger/trigger.install @@ -9,7 +9,7 @@ function trigger_install() { drupal_install_schema('trigger'); // Do initial synchronization of actions in code and the database. - actions_synchronize(actions_list()); + actions_synchronize(); } /**