You are here

message_digest_ui.post_update.php in Message Digest 8

Post update functions for the Message Digest UI module.

File

message_digest_ui/message_digest_ui.post_update.php
View source
<?php

/**
 * @file
 * Post update functions for the Message Digest UI module.
 */

/**
 * Renames interval plugin IDs to remove disallowed '.' from the name.
 */
function message_digest_ui_post_update_rename_action_plugins() {

  /** @var \Drupal\system\Entity\Action[] $actions */
  $actions = \Drupal::entityTypeManager()
    ->getStorage('action')
    ->loadMultiple();
  foreach ($actions as $action) {
    if (strpos($action
      ->id(), 'message_digest_interval') === 0) {
      $plugin_id = str_replace('.', ':', $action
        ->get('plugin'));
      $action
        ->setPlugin($plugin_id);
      $action
        ->save();
    }
  }
}

Functions

Namesort descending Description
message_digest_ui_post_update_rename_action_plugins Renames interval plugin IDs to remove disallowed '.' from the name.