- Patch #319404 by Dave Reid: simplify actions_sychronize and remove paramater.
parent
1415f6b743
commit
ee700371ac
|
@ -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) {
|
||||
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.
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue