Commit e0a4bc83 authored by Travis Tomka's avatar Travis Tomka
Browse files

Issue #3292348 by datvance, droath: Schema errors for notification_message.type.global

parent a5e44939
Loading
Loading
Loading
Loading
+3 −0
Changes for config/install/notification_message.type.global.yml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,3 +7,6 @@ help:
description: 'The <em>global</em> should be used to show notification messages throughout the site.'
allow_condition: true
condition_datatype: {  }
notification_dismiss:
    show: false
    button_text: Close
+21 −0
Changes for notification_message.install: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -22,3 +22,24 @@ function notification_message_update_8902(&$sandbox) {
    $entity_type_manager->getDefinition('notification_message')
  );
}

/**
 * Update notification message type to account for new dismiss configuration
 * parameters.
 */
function notification_message_update_8903(&$sandbox) {
  /** @var \Drupal\Core\Config\ConfigFactory $config_factory */
  $config_factory = \Drupal::configFactory();
  /** @var \Drupal\Core\Entity\EntityTypeManager $entity_type_manager */
  $entity_type_manager = \Drupal::service('entity_type.manager');
  $entity_type_storage = $entity_type_manager->getStorage('notification_message_type');

  /** @var \Drupal\notification_message\Entity\NotificationMessageType $notification_type */
  foreach($entity_type_storage->loadMultiple() as $notification_type) {
    $config = $config_factory->getEditable("notification_message.type.{$notification_type->id()}");
    $config->set('notification_dismiss', [
      'show' => false,
      'button_text' => 'Close']
    )->save();
  }
}