action.post_update.php

Same filename and directory in other branches
  1. 8.9.x core/modules/action/action.post_update.php
  2. 10 core/modules/action/action.post_update.php
  3. 11.x 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

Title Deprecated Summary
action_post_update_move_plugins Moves action plugins to core.
action_post_update_remove_settings Removes action settings.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.