From 2043d62261710d4924e18a7318de8c5232a0b2c7 Mon Sep 17 00:00:00 2001 From: Sascha Eggenberger <hello@saschaeggenberger.com> Date: Fri, 14 Jun 2024 14:39:31 +0200 Subject: [PATCH] Add check for routes --- src/GinContentFormHelper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/GinContentFormHelper.php b/src/GinContentFormHelper.php index 4ac835aa9..3aec859ce 100644 --- a/src/GinContentFormHelper.php +++ b/src/GinContentFormHelper.php @@ -286,6 +286,9 @@ class GinContentFormHelper implements ContainerInjectionInterface { /** @var \Drupal\gin\GinSettings $settings */ $settings = \Drupal::classResolver(GinSettings::class); + // Get route name. + $route_name = $this->routeMatch->getRouteName(); + // Sets default to TRUE if setting is enabled. $sticky_action_buttons = $settings->get('sticky_action_buttons') ? TRUE : FALSE; @@ -301,7 +304,8 @@ class GinContentFormHelper implements ContainerInjectionInterface { strpos($form_id, '_confirm_form') !== FALSE || strpos($form_id, '_paragraphs_component_form') !== FALSE || strpos($form_id, '_delete_component_form') !== FALSE || - in_array($form_id, $form_ids, TRUE) + in_array($form_id, $form_ids, TRUE) || + in_array($route_name, $form_ids, TRUE) ) { $sticky_action_buttons = FALSE; } -- GitLab