You are here

function action_post_update_move_plugins in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/action/action.post_update.php \action_post_update_move_plugins()

Moves action plugins to core.

File

core/modules/action/action.post_update.php, line 14
Post update functions for Action module.

Code

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);
  });
}