Browse Source

fix Module::getModulesByProductConfiguration

Olivier Massot 1 year ago
parent
commit
5bb6c9b970
1 changed files with 3 additions and 5 deletions
  1. 3 5
      src/Service/Security/Module.php

+ 3 - 5
src/Service/Security/Module.php

@@ -130,12 +130,10 @@ class Module
     {
         $opentalentProducts = $this->parameterBag->get('opentalent.products');
 
-        $productKey = str_replace('-', '_', $product->value);
-
-        if (!array_key_exists($productKey, $opentalentProducts)) {
-            throw new AccessDeniedHttpException(sprintf('The product %s does not exist !', $productKey));
+        if (!array_key_exists($product->value, $opentalentProducts)) {
+            throw new AccessDeniedHttpException(sprintf('The product %s does not exist !', $product->value));
         }
-        $productConfig = $opentalentProducts[$productKey];
+        $productConfig = $opentalentProducts[$product->value];
         $modules = $productConfig['modules'] ?? [];
 
         if (array_key_exists('extend', $productConfig)) {