From b685c928e488e8bc51191f8061c87644f7fae113 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Wed, 8 Oct 2025 07:25:32 +0000 Subject: [PATCH] fix(BOOK-413): Respecting original_url inside RTE for entry links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Approved-by: Matilda Landström --- .../lib/components/JsonToHtml/renderOptions.tsx | 9 +++++++-- .../lib/graphql/Fragments/PageLink/HotelPageLink.graphql | 4 ---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/design-system/lib/components/JsonToHtml/renderOptions.tsx b/packages/design-system/lib/components/JsonToHtml/renderOptions.tsx index 3534bb99e..c022a8e9f 100644 --- a/packages/design-system/lib/components/JsonToHtml/renderOptions.tsx +++ b/packages/design-system/lib/components/JsonToHtml/renderOptions.tsx @@ -451,17 +451,22 @@ export const renderOptions: RenderOptions = { ) { // If entry is not an ImageContainer, it is a page and we return it as a link const { className, ...props } = extractPossibleAttributes(node.attrs) + const entryHref = entry.node.url - const href = node.attrs?.locale + const nodeHref = node.attrs?.locale ? `/${node.attrs.locale}${node.attrs.href ?? node.attrs.url}` : ((node.attrs.href ?? node.attrs.url) as string) + if (!entryHref && !nodeHref) { + return null + } + return ( {next( diff --git a/packages/trpc/lib/graphql/Fragments/PageLink/HotelPageLink.graphql b/packages/trpc/lib/graphql/Fragments/PageLink/HotelPageLink.graphql index cc5f1f5ff..23b7d2fd9 100644 --- a/packages/trpc/lib/graphql/Fragments/PageLink/HotelPageLink.graphql +++ b/packages/trpc/lib/graphql/Fragments/PageLink/HotelPageLink.graphql @@ -6,8 +6,4 @@ fragment HotelPageLink on HotelPage { } title url - # TODO: Might need to add this if this is needed for hotel pages. - # web { - # original_url - # } }