From fc0dc8e1b62855565743a2f217d5cf7b38eed61f Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 10 Dec 2024 12:33:33 +0100 Subject: [PATCH 1/2] Fix footer links if the link is not set. --- .../volto-light-theme/src/components/Footer/FooterLinks.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx b/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx index 79c10ce4..a48bec1f 100644 --- a/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx +++ b/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx @@ -14,8 +14,11 @@ const FooterLinks = (props: FooterLinksProps) => { {!isEmpty(links?.blocks) ? links.blocks_layout.items.map((itemId) => { const link = links.blocks[itemId]; + + if (isEmpty(link) || !link.href) return null; + const title = link.title || link.href[0]['title']; - const href = flattenToAppURL(link.href[0]['@id']); + const href = flattenToAppURL(link.href[0]?.['@id']); if (!href) return null; From 13b7bb0f09c2efdaa507d3877c60b0595e1e9283 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 10 Dec 2024 12:34:21 +0100 Subject: [PATCH 2/2] Changelog --- packages/volto-light-theme/news/445.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/volto-light-theme/news/445.bugfix diff --git a/packages/volto-light-theme/news/445.bugfix b/packages/volto-light-theme/news/445.bugfix new file mode 100644 index 00000000..7c136074 --- /dev/null +++ b/packages/volto-light-theme/news/445.bugfix @@ -0,0 +1 @@ +Fixed footerlinks error if the link is created but not set. @sneridagh