|
@@ -128,17 +128,19 @@ class Module
|
|
|
*/
|
|
*/
|
|
|
public function getModulesByProductConfiguration(SettingsProductEnum $product): ?array
|
|
public function getModulesByProductConfiguration(SettingsProductEnum $product): ?array
|
|
|
{
|
|
{
|
|
|
- $product = str_replace('-', '_', $product->value);
|
|
|
|
|
$opentalentProducts = $this->parameterBag->get('opentalent.products');
|
|
$opentalentProducts = $this->parameterBag->get('opentalent.products');
|
|
|
|
|
|
|
|
- if (!array_key_exists($product, $opentalentProducts)) {
|
|
|
|
|
- throw new AccessDeniedHttpException(sprintf('The product %s does not exist !', $product));
|
|
|
|
|
|
|
+ if (!array_key_exists($product->value, $opentalentProducts)) {
|
|
|
|
|
+ throw new AccessDeniedHttpException(sprintf('The product %s does not exist !', $product->value));
|
|
|
}
|
|
}
|
|
|
- $productConfig = $opentalentProducts[$product];
|
|
|
|
|
|
|
+ $productConfig = $opentalentProducts[$product->value];
|
|
|
$modules = $productConfig['modules'] ?? [];
|
|
$modules = $productConfig['modules'] ?? [];
|
|
|
|
|
|
|
|
if (array_key_exists('extend', $productConfig)) {
|
|
if (array_key_exists('extend', $productConfig)) {
|
|
|
- $modules = array_merge($modules, $this->getModulesByProductConfiguration(SettingsProductEnum::from($productConfig['extend'])));
|
|
|
|
|
|
|
+ $modules = array_merge(
|
|
|
|
|
+ $modules,
|
|
|
|
|
+ $this->getModulesByProductConfiguration(SettingsProductEnum::from($productConfig['extend']))
|
|
|
|
|
+ );
|
|
|
unset($productConfig['extend']);
|
|
unset($productConfig['extend']);
|
|
|
}
|
|
}
|
|
|
|
|
|