summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/actions.inc11
-rw-r--r--modules/system/system.module4
-rw-r--r--modules/trigger/trigger.install2
3 files changed, 10 insertions, 7 deletions
diff --git a/includes/actions.inc b/includes/actions.inc
index 98b9b8eae..f18f54c5c 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 ad56aea37..3e77dde00 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 03c8585bf..c6bb061b0 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();
}
/**