Skip to content

Conversation

kjac
Copy link
Contributor

@kjac kjac commented Sep 16, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

Description

This is a cherry-pick of #20142 for V16.

Due to changes in V14, we now treat UDI based local links as "legacy", and GUID based local links as "present". This caused some merge conflicts. It also required a few extra unit tests to prove that the fix for the original issue works for both types of local links. Hence this cherry-pick being a PR 😄

Testing this PR

See #20142

…#20142)

* Support querystring and anchor for local links in Delivery API output

* Add default implementation for backwards compat

* Add default implementation for backwards compat (also on the interface)

* Fix default implementation
…ocal links in both legacy and current format.
Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Again, I've tested it out with variations of links and delivery API output using JSON or HTML for markup, and all seems as expected.

Naming is a little odd given we have both an anchor and a queryString field, with both containing the same value. But I assume, even if wanted to change this, we have to keep it for backward compatibility.

"tag": "a",
  "attributes": {
      "target": "",
      "anchor": "?foo=bar",
      "router-slot": "disabled",
      "title": "Ravi Motha",
      "type": "document",
      "route": {
          "path": "/people/ravi-motha/",
          "queryString": "?foo=bar",
          "startItem": {
              "id": "ca4249ed-2b23-4337-b522-63cabe5587d1",
              "path": "home"
          }
      }
  }

I'll leave you to merge just in case you want to comment or act on this point.

@kjac
Copy link
Contributor Author

kjac commented Sep 16, 2025

Thanks @AndyButland 👍

This does look weird, but it aligns with the V13 output:

image

Once you know what's happening, things becomes a little clearer.

The attributes collection in the a tag is the serialized version of the Attributes collection from the RichTextGenericElement. This collection populated straight from the markup source:

image

The route object in the output attributes is the serialized version of the ApiContentRoute, and this is where we find the source of the queryString output property.

@kjac kjac merged commit ef1aaf8 into main Sep 16, 2025
24 of 25 checks passed
@kjac kjac deleted the v16/task/cherry-pick-20142 branch September 16, 2025 09:33
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