Skip to content

No way to get the URL the visitor actually receives #772

Description

@romain-pm

Part of #749. There is no way to obtain the URL a visitor will actually receive.

anchor.href is a server-side intermediate. Core's URLFilter completes it after the render, and only for URLTraverser's tag/attribute pairs in an html template type. Anything else keeps the raw /cms/... form: an Island payload, a data-* attribute, an action's JSON response, a meta tag. The JSDoc says so; nothing offers a way out.

Three concrete consequences, all measured:

  • Jahia/jahia.com's 15-year-old workaround survived the adoption verbatim: buildNodeUrl(target).replace("/cms/edit/", "/cms/editframe/") in NavBar.tsx, because its nav is Island-driven and the URL in the payload is never rewritten. Adopting <JLink> did not remove it and could not.

  • data-element-url on that site still carries a different URL from its sibling href, for the same reason.

  • Any module doing client-side navigation from server-supplied URLs has the same bug and no way to know.

  • Decide the remedy: a mode: "editframe" on buildNodeUrl (buildNodeUrl gaps a link component cannot work around #756 already lists mode: "edit" emitting the wrong servlet path), an absolute option that resolves through the rewrite layer, or an explicit "final URL" call that runs the outbound rules the way response.encodeURL does.

  • Whatever the answer, the guide must state which contexts get a rewritten URL and which do not — today a developer discovers it by shipping a broken edit-mode link.

  • Check whether the /cms/edit/ -> /cms/editframe/ replace is even still needed on 8.2.3, or is cargo from an older core. If it is obsolete, most of this shrinks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featA new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions