Loading src/Form/TabManagerConfigForm.php +0 −19 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ namespace Drupal\tab_manager\Form; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Config form for the "Tab Manger" module. Loading @@ -20,22 +19,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class TabManagerConfigForm extends ConfigFormBase { /** * Router builder. * * @var \Drupal\Core\Routing\RouteBuilderInterface */ protected $routerBuilder; /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { $instance = parent::create($container); $instance->routerBuilder = $container->get('router.builder'); return $instance; } /** * {@inheritdoc} */ Loading Loading @@ -76,8 +59,6 @@ class TabManagerConfigForm extends ConfigFormBase { $value = $form_state->getValue('apply_changes_for_administrator_role'); $config->set('apply_changes_for_administrator_role', $value)->save(); parent::submitForm($form, $form_state); // Flush routing and links cashes. $this->routerBuilder->rebuild(); } } src/Form/TabManagerSettingsForm.php +0 −10 Original line number Diff line number Diff line Loading @@ -18,20 +18,12 @@ class TabManagerSettingsForm extends ConfigFormBase { */ protected $state; /** * Router builder. * * @var \Drupal\Core\Routing\RouteBuilderInterface */ protected $routerBuilder; /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { $instance = parent::create($container); $instance->state = $container->get('state'); $instance->routerBuilder = $container->get('router.builder'); return $instance; } Loading Loading @@ -169,8 +161,6 @@ class TabManagerSettingsForm extends ConfigFormBase { else { $this->resetToDefault($modified_tabs); } // Flush routing and links cashes. $this->routerBuilder->rebuild(); // Redirect to the page with tabs to force reloading and to see changes. $tabs_page_url = $this->state->get('tab_manager_tabs_page_url'); Loading tab_manager.module +6 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,12 @@ use Drupal\Core\Entity\ContentEntityInterface; */ function tab_manager_menu_local_tasks_alter(&$data, $route_name) { // Add cache tags to rerender local tasks after setting changes. $data['cacheability']->addCacheTags([ 'config:tab_manager.config', 'config:tab_manager.settings', ]); if ($route_name === 'tab_manager.settings' || $route_name === 'tab_manager.config') { return; } Loading Loading
src/Form/TabManagerConfigForm.php +0 −19 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ namespace Drupal\tab_manager\Form; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Config form for the "Tab Manger" module. Loading @@ -20,22 +19,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class TabManagerConfigForm extends ConfigFormBase { /** * Router builder. * * @var \Drupal\Core\Routing\RouteBuilderInterface */ protected $routerBuilder; /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { $instance = parent::create($container); $instance->routerBuilder = $container->get('router.builder'); return $instance; } /** * {@inheritdoc} */ Loading Loading @@ -76,8 +59,6 @@ class TabManagerConfigForm extends ConfigFormBase { $value = $form_state->getValue('apply_changes_for_administrator_role'); $config->set('apply_changes_for_administrator_role', $value)->save(); parent::submitForm($form, $form_state); // Flush routing and links cashes. $this->routerBuilder->rebuild(); } }
src/Form/TabManagerSettingsForm.php +0 −10 Original line number Diff line number Diff line Loading @@ -18,20 +18,12 @@ class TabManagerSettingsForm extends ConfigFormBase { */ protected $state; /** * Router builder. * * @var \Drupal\Core\Routing\RouteBuilderInterface */ protected $routerBuilder; /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { $instance = parent::create($container); $instance->state = $container->get('state'); $instance->routerBuilder = $container->get('router.builder'); return $instance; } Loading Loading @@ -169,8 +161,6 @@ class TabManagerSettingsForm extends ConfigFormBase { else { $this->resetToDefault($modified_tabs); } // Flush routing and links cashes. $this->routerBuilder->rebuild(); // Redirect to the page with tabs to force reloading and to see changes. $tabs_page_url = $this->state->get('tab_manager_tabs_page_url'); Loading
tab_manager.module +6 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,12 @@ use Drupal\Core\Entity\ContentEntityInterface; */ function tab_manager_menu_local_tasks_alter(&$data, $route_name) { // Add cache tags to rerender local tasks after setting changes. $data['cacheability']->addCacheTags([ 'config:tab_manager.config', 'config:tab_manager.settings', ]); if ($route_name === 'tab_manager.settings' || $route_name === 'tab_manager.config') { return; } Loading