Skip to content

Commit

Permalink
EWPP-2831: Update behavior for ecl_footer_links twig function.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergepavle authored and imanoleguskiza committed Dec 5, 2022
1 parent 84a2a8e commit b1c7d41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions modules/oe_theme_helper/src/TwigExtension/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit b1c7d41

Please sign in to comment.