Skip to content
Merged
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
34 changes: 34 additions & 0 deletions tide_core.install
Original file line number Diff line number Diff line change
Expand Up @@ -1400,3 +1400,37 @@ function tide_core_update_10038() {
function tide_core_update_10039() {
\Drupal::service('module_installer')->install(['views_bulk_operations', 'views_bulk_edit']);
}

/**
* Hide nav title field node form displays.
*/
function tide_core_update_10040() {
$description = 'Tick this checkbox to display a side menu on this page. The menu belongs to the site section this page is tagged to. To change the menu heading that displays on live, pages, <a href=\'https://digital-vic.atlassian.net/servicedesk/customer/portal/27/group/145/create/507\' target="_blank">submit a support request</a>.';
$bundles = \Drupal::service('entity_type.bundle.info')->getBundleInfo('node');
$storage = \Drupal::entityTypeManager()->getStorage('entity_form_display');
foreach (array_keys($bundles) as $bundle) {
/** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface|null $form_display */
$form_display = $storage->load('node.' . $bundle . '.default');
if ($form_display === NULL) {
continue;
}
$changed = FALSE;
if ($form_display->getComponent('field_landing_page_nav_title') !== NULL) {
$form_display->removeComponent('field_landing_page_nav_title');
$changed = TRUE;
}
$group = $form_display->getThirdPartySetting('field_group', 'group_site_section_navigation');
if ($group !== NULL) {
$group['children'] = array_values(array_diff($group['children'] ?? [], ['field_landing_page_nav_title']));
$group['format_settings']['show_empty_fields'] = FALSE;
$group['format_settings']['label_as_html'] = TRUE;
$group['format_settings']['description'] = $description;
unset($group['format_settings']['formatter']);
$form_display->setThirdPartySetting('field_group', 'group_site_section_navigation', $group);
$changed = TRUE;
}
if ($changed) {
$form_display->save();
}
}
}
Loading