Skip to content

fix(storyblok-ui): resolve story multilinks to the target's current slug - #2661

Merged
paales merged 1 commit into
canaryfrom
storyblok-multilink-prefer-resolved-full-slug
Aug 6, 2026
Merged

fix(storyblok-ui): resolve story multilinks to the target's current slug#2661
paales merged 1 commit into
canaryfrom
storyblok-multilink-prefer-resolved-full-slug

Conversation

@paales

@paales paales commented Aug 6, 2026

Copy link
Copy Markdown
Member

Written by Claude Code:

A story multilink carries the target twice, and only one of the two is current:

field meaning
cached_url the target's full_slug as it was when the referencing story was last published. Renaming the target does not rewrite it in already-published content.
story.full_slug injected by @storyblok/react from the links map the CDN builds from the live story index on every request. sbParams already sends resolve_links: 'story' on all reads, so it is populated for every story link.

multilinkHref preferred cached_url, so renaming a story left every link to it emitting the old URL — a 404 — until an editor re-published each referencing story individually. That is easy to miss for links in a shared global-config story: the config is embedded in each page's getStaticProps output, so the stale href also lingers per page for as long as that page's ISR entry lives, making the same link appear broken on some routes and fine on others.

This PR prefers the resolved story.full_slug for linktype: 'story', which makes story links self-healing across renames — no re-publish of referencing stories needed. url / email / asset links have no resolved story and fall through to the existing behaviour unchanged.

Found on a production storefront where the footer's "Retourneren" link pointed at /klantenservice/Retourneren after the target story had been renamed to lowercase retourneren.

🤖 Generated with Claude Code

`multilinkHref` preferred the multilink's `cached_url`, which Storyblok freezes
at the moment the *referencing* story is published. Renaming the target story
does not rewrite it in already-published content, so every link to the renamed
story kept emitting the old URL — a 404 — until an editor re-published each
referencing story.

`story.full_slug` is injected by `@storyblok/react` from the `links` map the CDN
builds from the live story index on every request, and `sbParams` already sends
`resolve_links: 'story'` on all reads, so it is populated for story links and
always current. Prefer it, and fall through unchanged for `url` / `email` /
`asset` links, which have no resolved story.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c849720

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 86 packages
Name Type
@graphcommerce/storyblok-ui Patch
@graphcommerce/magento-storyblok Patch
@graphcommerce/docs Patch
@graphcommerce/browserslist-config-pwa Patch
@graphcommerce/changeset-changelog Patch
@graphcommerce/eslint-config-pwa Patch
@graphcommerce/graphql-codegen-markdown-docs Patch
@graphcommerce/graphql-codegen-near-operation-file Patch
@graphcommerce/graphql-codegen-relay-optimizer-plugin Patch
@graphcommerce/misc Patch
@graphcommerce/next-config Patch
@graphcommerce/prettier-config-pwa Patch
@graphcommerce/typescript-config-pwa Patch
@graphcommerce/address-fields-nl Patch
@graphcommerce/algolia-categories Patch
@graphcommerce/algolia-insights Patch
@graphcommerce/algolia-personalization Patch
@graphcommerce/algolia-products Patch
@graphcommerce/algolia-recommend Patch
@graphcommerce/algolia-search Patch
@graphcommerce/cli Patch
@graphcommerce/demo-magento-graphcommerce Patch
@graphcommerce/ecommerce-ui Patch
@graphcommerce/framer-next-pages Patch
@graphcommerce/framer-scroller Patch
@graphcommerce/framer-utils Patch
@graphcommerce/google-datalayer Patch
@graphcommerce/google-playstore Patch
@graphcommerce/googleanalytics Patch
@graphcommerce/googlerecaptcha Patch
@graphcommerce/googletagmanager Patch
@graphcommerce/graphcms-ui Patch
@graphcommerce/graphql-mesh Patch
@graphcommerce/graphql Patch
@graphcommerce/hygraph-cli Patch
@graphcommerce/hygraph-dynamic-rows-ui Patch
@graphcommerce/hygraph-dynamic-rows Patch
@graphcommerce/hygraph-ui Patch
@graphcommerce/image Patch
@graphcommerce/lingui-next Patch
@graphcommerce/magento-cart-checkout Patch
@graphcommerce/magento-cart-coupon Patch
@graphcommerce/magento-cart-email Patch
@graphcommerce/magento-cart-items Patch
@graphcommerce/magento-cart-payment-method Patch
@graphcommerce/magento-cart-pickup Patch
@graphcommerce/magento-cart-shipping-address Patch
@graphcommerce/magento-cart-shipping-method Patch
@graphcommerce/magento-cart Patch
@graphcommerce/magento-category Patch
@graphcommerce/magento-cms Patch
@graphcommerce/magento-compare Patch
@graphcommerce/magento-customer Patch
@graphcommerce/magento-graphql-rest Patch
@graphcommerce/magento-graphql Patch
@graphcommerce/magento-newsletter Patch
@graphcommerce/magento-payment-adyen Patch
@graphcommerce/magento-payment-afterpay Patch
@graphcommerce/magento-payment-braintree Patch
@graphcommerce/magento-payment-included Patch
@graphcommerce/magento-payment-klarna Patch
@graphcommerce/magento-payment-multisafepay Patch
@graphcommerce/magento-payment-paypal Patch
@graphcommerce/magento-payment-tokens Patch
@graphcommerce/magento-product-bundle Patch
@graphcommerce/magento-product-configurable Patch
@graphcommerce/magento-product-downloadable Patch
@graphcommerce/magento-product-grouped Patch
@graphcommerce/magento-product-simple Patch
@graphcommerce/magento-product-virtual Patch
@graphcommerce/magento-product Patch
@graphcommerce/magento-recently-viewed-products Patch
@graphcommerce/magento-review Patch
@graphcommerce/magento-search-overlay Patch
@graphcommerce/magento-search Patch
@graphcommerce/magento-store Patch
@graphcommerce/magento-wishlist Patch
@graphcommerce/mollie-magento-payment Patch
@graphcommerce/next-ui Patch
@graphcommerce/react-hook-form Patch
@graphcommerce/service-worker Patch
@graphcommerce/framer-next-pages-example Patch
@graphcommerce/framer-scroller-example Patch
@graphcommerce/image-example Patch
@graphcommerce/magento-graphcms Patch
@graphcommerce/magento-open-source Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
graphcommerce-246 Ready Ready Preview Aug 6, 2026 12:03pm
graphcommerce-247 Error Error Aug 6, 2026 12:03pm
graphcommerce-hygraph-dynamic-rows-ui Ready Ready Preview Aug 6, 2026 12:03pm
graphcommerce-open-source Ready Ready Preview Aug 6, 2026 12:03pm
graphcommerce-storyblok Ready Ready Preview Aug 6, 2026 12:03pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants