You are here

action.post_update.php in Drupal 8

Same filename and directory in other branches
  1. 9 core/modules/action/action.post_update.php

Post update functions for Action module.

File

core/modules/action/action.post_update.php
View source
<?php

/**
 * @file
 * Post update functions for Action module.
 */
use Drupal\Core\Config\Entity\ConfigEntityUpdater;
use Drupal\system\ActionConfigEntityInterface;

/**
 * Moves action plugins to core.
 */
function action_post_update_move_plugins(&$sandbox = NULL) {
  $resave_ids = [
    'action_goto_action',
    'action_message_action',
    'action_send_email_action',
  ];
  \Drupal::classResolver(ConfigEntityUpdater::class)
    ->update($sandbox, 'action', function (ActionConfigEntityInterface $action) use ($resave_ids) {

    // Save entity to recalculate dependencies.
    return $action
      ->isConfigurable() && in_array($action
      ->getPlugin()
      ->getPluginId(), $resave_ids, TRUE);
  });
}

/**
 * Removes action settings.
 */
function action_post_update_remove_settings() {
  \Drupal::configFactory()
    ->getEditable('action.settings')
    ->delete();
}

Functions

Namesort descending Description
action_post_update_move_plugins Moves action plugins to core.
action_post_update_remove_settings Removes action settings.