function modal_page_update_8207 in Modal 5.0.x
Same name and namespace in other branches
- 8.3 modal_page.install \modal_page_update_8207()
- 8.2 modal_page.install \modal_page_update_8207()
- 4.0.x modal_page.install \modal_page_update_8207()
- 4.1.x modal_page.install \modal_page_update_8207()
Created new field "Don't show again".
File
- ./
modal_page.install, line 315 - Install, update and uninstall functions for the Modal Page.
Code
function modal_page_update_8207() {
$field_storage_definition = BaseFieldDefinition::create('boolean')
->setLabel(t("Enable <b>Don't show again</b> option"))
->setDefaultValue(TRUE)
->setDisplayConfigurable('form', TRUE)
->setDisplayOptions('form', [
'type' => 'boolean_checkbox',
'settings' => [
'display_label' => TRUE,
],
'weight' => -5,
]);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('enable_dont_show_again_option', 'modal_page_modal', 'modal_page_modal', $field_storage_definition);
$field_to_be_updated = [
'enable_dont_show_again_option' => TRUE,
];
modal_page_update_modal_table($field_to_be_updated);
\Drupal::service('cache.render')
->invalidateAll();
}