function system_update_8021

Enable the Actions module.

Related topics

File

drupal/core/modules/system/system.install, line 1553
Install, update and uninstall functions for the system module.

Code

function system_update_8021() {

  // Enable the module without re-installing the schema.
  module_enable(array(
    'action',
  ));

  // Rename former System module actions.
  $map = array(
    'system_message_action' => 'action_message_action',
    'system_send_email_action' => 'action_send_email_action',
    'system_goto_action' => 'action_goto_action',
  );
  foreach ($map as $old => $new) {

    // Rename all references to the action callback.
    db_update('actions')
      ->fields(array(
      'callback' => $new,
    ))
      ->condition('callback', $old)
      ->execute();

    // Rename the action's aid.
    db_update('actions')
      ->fields(array(
      'aid' => $new,
    ))
      ->condition('aid', $old)
      ->execute();
  }
}