Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
ee700371
Commit
ee700371
authored
Dec 20, 2008
by
Dries
Browse files
- Patch
#319404
by Dave Reid: simplify actions_sychronize and remove paramater.
parent
1415f6b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/actions.inc
View file @
ee700371
...
...
@@ -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.
...
...
modules/system/system.module
View file @
ee700371
...
...
@@ -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'
);
}
...
...
modules/trigger/trigger.install
View file @
ee700371
...
...
@@ -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
();
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment