fix(urlmap): use configured detail page when not found on requesting site (#35268)#36000
Conversation
…site (#35268) When the detail page is configured on a different host (e.g. //global/), fall back to the configured identifier instead of returning empty and producing a 404. Content host isolation is preserved — buildContentQuery() still restricts content to the current site and SYSTEM_HOST. Refs: #35268 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @dsilvam's task in 2m 26s —— View job dotCMS Backend Review Pipeline
All four specialized reviewers (Security, Database, Java Standards, REST API) returned no findings. The change is a targeted one-liner in
|
|
✅ dotCMS Backend Review: no issues found. |
Proposed Changes
URLMapAPIImpl.getDetailPageUri(), when the configured detail page lives on a different host (e.g.//global/) and no matching path exists on the requesting site, fall back to the configured identifier instead of returningOptional.empty().Root Cause
The runtime URL map flow has two steps:
buildContentQuery()— finds the URL-mapped contentlet via ES, restricted to+(conhost:<currentSite> OR conhost:SYSTEM_HOST)✅getDetailPageUri()— resolves the rendering page from the content type'sdetailPageidentifierStep 2 correctly handles the case where the detail page is on the current host. When it isn't, it tries to find a page at the same path on the current host. If nothing is found (e.g. the page is on
//global/), it was returningOptional.empty()→ 404. The fix returns the configured identifier directly as a safe fallback.Content host isolation is fully preserved — only step 1 determines which contentlet is returned, and that query is never modified.
This restores the targeted
getDetailPageUri()fallback that was reverted in #35622 alongside the unsafe cross-site ES query change. The unsafebuildContentQuery()change is not reintroduced.Checklist
processURLMap_detailPageOnDifferentHost_shouldResolveWithConfiguredDetailPageadded toURLMapAPIImplTest; existing cross-site bleed guardprocessURLMap_mustNotReturnContentFromForeignHost_whenRequestingHostHasNoMatchstill passesAdditional Info
getDetailPageUri()path, notbuildContentQuery().URLMapAPIImplTesttests pass (1 pre-existing@Ignoreskipped)Closes #35268
This PR fixes: #35268