You are here

function modal_page_update_40001 in Modal 5.0.x

Same name and namespace in other branches
  1. 8.3 modal_page.install \modal_page_update_40001()
  2. 4.0.x modal_page.install \modal_page_update_40001()
  3. 4.1.x modal_page.install \modal_page_update_40001()

Created new field to choose label "Don't show again".

File

./modal_page.install, line 291
Install, update and uninstall functions for the Modal Page.

Code

function modal_page_update_40001() {
  $modalPageFieldHelper = new ModalPageFieldHelper();
  $fieldDontShowAgainLabel = $modalPageFieldHelper
    ->getFieldDontShowAgainLabel();
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('dont_show_again_label', 'modal_page_modal', 'modal_page_modal', $fieldDontShowAgainLabel);
  $field_to_be_updated = [
    'dont_show_again_label' => t("Don't show again"),
  ];
  modal_page_update_modal_table($field_to_be_updated);
  \Drupal::service('cache.render')
    ->invalidateAll();
}