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:
Part of #749. There is no way to obtain the URL a visitor will actually receive.
anchor.hrefis a server-side intermediate. Core'sURLFiltercompletes it after the render, and only forURLTraverser's tag/attribute pairs in an html template type. Anything else keeps the raw/cms/...form: an Island payload, adata-*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/")inNavBar.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-urlon that site still carries a different URL from its siblinghref, 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"onbuildNodeUrl(buildNodeUrl gaps a link component cannot work around #756 already listsmode: "edit"emitting the wrong servlet path), anabsoluteoption that resolves through the rewrite layer, or an explicit "final URL" call that runs the outbound rules the wayresponse.encodeURLdoes.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.