From eb6944c4aa4f64182fb3218b5fe17711d423f793 Mon Sep 17 00:00:00 2001 From: Ryan Koch Date: Fri, 3 Jan 2025 11:03:43 -0600 Subject: [PATCH] Small fix to `hasRequirement` check. Cannot take a specific permission as a second parameter. We'll set the permission whenever one is not set. --- .../custom/va_gov_form_builder/src/Routing/RouteSubscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docroot/modules/custom/va_gov_form_builder/src/Routing/RouteSubscriber.php b/docroot/modules/custom/va_gov_form_builder/src/Routing/RouteSubscriber.php index 14d76da023..c7876c5878 100644 --- a/docroot/modules/custom/va_gov_form_builder/src/Routing/RouteSubscriber.php +++ b/docroot/modules/custom/va_gov_form_builder/src/Routing/RouteSubscriber.php @@ -16,7 +16,7 @@ class RouteSubscriber extends RouteSubscriberBase { protected function alterRoutes(RouteCollection $collection) { foreach ($collection->all() as $route_name => $route) { if (strpos($route_name, 'va_gov_form_builder.') === 0) { - if (!$route->hasRequirement('_permission', 'access form builder')) { + if (!$route->hasRequirement('_permission')) { $route->setRequirement('_permission', 'access form builder'); } }