diff --git a/composer.json b/composer.json index eb0a37fa0..e2196f6f9 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "openeuropa/code-review": "^2.0", "openeuropa/oe_contact_forms": "^1.5", "openeuropa/oe_content": "^3.0.0-alpha4", - "openeuropa/oe_corporate_blocks": "^4.4", + "openeuropa/oe_corporate_blocks": "4.x-dev", "openeuropa/oe_corporate_countries": "~2.0", "openeuropa/oe_media": "^1.19", "openeuropa/oe_multilingual": "^1.10", diff --git a/modules/oe_theme_helper/src/TwigExtension/TwigExtension.php b/modules/oe_theme_helper/src/TwigExtension/TwigExtension.php index fd3470a5d..7762471b4 100644 --- a/modules/oe_theme_helper/src/TwigExtension/TwigExtension.php +++ b/modules/oe_theme_helper/src/TwigExtension/TwigExtension.php @@ -28,6 +28,8 @@ * * We don't enforce any strict type checking on filters' arguments as they are * coming straight from Twig templates. + * + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class TwigExtension extends AbstractExtension { @@ -571,6 +573,11 @@ public function eclFooterLinks(array $context, array $links): array { $ecl_links = []; foreach ($links as $link) { + // Skip if the link is limited to some ECL branding and the current + // ECL branding does not match. + if (!empty($link['branding']) && $context['ecl_branding'] !== $link['branding']) { + continue; + } $ecl_link = [ 'link' => [ 'label' => $link['label'],