Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Remove hide link" checkbox for full page banner #190

Merged
merged 2 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ content:
media_types: { }
third_party_settings: { }
region: content
remove_hide_link:
type: boolean_checkbox
weight: 3
region: content
settings:
display_label: true
third_party_settings: { }
title:
type: string_textfield
weight: 1
Expand All @@ -77,4 +70,5 @@ content:
match_limit: 10
region: content
third_party_settings: { }
hidden: { }
hidden:
remove_hide_link: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

/**
* @file
* Module updates.
*/

declare(strict_types = 1);

/**
* Implements hook_update_N().
*
* Hides the "Remove hide link" checkbox from Full page alert edit pages.
*/
function localgov_alert_banner_full_page_update_9001() {

$form_display = Drupal::service('entity_type.manager')
->getStorage('entity_form_display')
->load('localgov_alert_banner.localgov_full_page.default');
if (!$form_display) {
return t('Cannot find form display for Full page alert.');
}

$remove_hide_link = $form_display->getComponent('remove_hide_link');
if ($remove_hide_link) {
$form_display->removeComponent('remove_hide_link')->save();
}
else {
return t('Cannot find settings for the "Remove hide link" checkbox.');
}
}