Skip to content
Snippets Groups Projects
Commit d07ee981 authored by Eric Bremner's avatar Eric Bremner
Browse files

Merge branch '8.x-1.x' into feature/ISTWCMS-4208-ebremner-unpublishing

parents 18ae8fb0 0ae898e4
No related branches found
No related tags found
1 merge request!19Feature/istwcms 4208 ebremner unpublishing
......@@ -5,10 +5,31 @@
* Module file.
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\WebformInterface;
use Drupal\webform\WebformSubmissionStorageInterface;
/**
* Implements hook_entity_presave().
*/
function uw_cfg_common_entity_presave(EntityInterface $entity) {
// Check if we are on a menu link.
if ($entity->getEntityTypeId() == 'menu_link_content') {
// Check that we are on a Information For (audience) link.
if ($entity->menu_name->value == 'uw-menu-audience-menu') {
// Invalid all the menu caching.
\Drupal::cache('menu')->invalidateAll();
// Rebuild all the menus.
\Drupal::service('plugin.manager.menu.link')->rebuild();
}
}
}
/**
* Implements hook_form_FORM_ID_alter().
*
......@@ -19,7 +40,7 @@ function uw_cfg_common_form_layout_builder_configure_section_alter(array &$form,
unset($form['layout_builder_style']['#empty_option']);
// Ensuring that the contained width is selected by default.
$form['layout_builder_style']['#default_value'] = $form['layout_builder_style']['#default_value'] ?: 'uw-contained-width';
$form['layout_builder_style']['#default_value'] = $form['layout_builder_style']['#default_value'] ?: 'uw_lbs_contained_width';
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment