dotCMS / dotCMS/core

UVE toolbar address bar and copy-url strip the base path when the EMA/UVE app "url" contains a path segment

Open
#36,730 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support Team : Maintenance Type : Defect
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Description

When a UVE/EMA app is configured with a url that includes a path segment (e.g. https://my-frontend.example.com/uve), the editor's toolbar address bar and the "copy URL" popover drop that path segment from the displayed/copied URL. The URL the editor actually loads in the iframe is correct — only the displayed and copied values are wrong.

Steps to reproduce
  1. Configure a UVE/EMA app entry whose url includes a base path, mapped to a pattern:
    { "config": [ { "pattern": "/my/page", "url": "https://my-frontend.example.com/uve" } ] }
    
  2. Open a page matching the pattern in the UVE.
  3. Look at the toolbar address bar and click the "copy URL" button.
Expected

The address bar and copy-url show the full URL including the configured base path:
https://my-frontend.example.com/uve/my/page

Actual

The base path (/uve) is dropped:
https://my-frontend.example.com/my/page

Scope / notes
  • Only affects display. The iframe request is built by buildIframeURL (withEditor.ts) via string concatenation, which correctly preserves the base path. The bug is isolated to the toolbar/copy-url values.
  • Only triggers when the configured url has a path segment. With a bare host (https://my-frontend.example.com) there is no path to lose, so the output is correct — which is why this is rarely seen.
Root cause

The toolbar/copy-url values are built with new URL(path, host), where host is the configured app url and path is the page path with a leading slash (/my/page). Per the URL spec, an absolute-path first argument replaces the base's entire pathname, discarding /uve.

Minimal demonstration:

new URL('/my/page', 'https://host.example.com/uve').toString()
// → 'https://host.example.com/my/page'   (base path lost)

'https://host.example.com/uve'.replace(/\/$/, '') + '/my/page'
// → 'https://host.example.com/uve/my/page'   (correct — what buildIframeURL does)
Affected code
  • core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts:1793$pageURLS computed: new URL(path, host) (line 1804) and new URL(path, https://<siteHostname>) (line 1815)
  • core-web/libs/portlets/edit-ema/portlet/src/lib/utils/index.ts:609createFullURL: new URL( + "${url}?..." + , clientHost) (line 626), used for the "current view" entry (edit-ema-editor.component.ts:1808)
  • Consumed by the template at edit-ema-editor.component.html:107 ($pageURL → address bar) and :82 (copy-url popover)
  • Correct reference implementation: buildIframeURL at core-web/libs/portlets/edit-ema/portlet/src/lib/store/features/editor/withEditor.ts:61
Suggested fix direction

Build the toolbar/copy-url values by appending the page path to the full configured base (as buildIframeURL does) instead of resolving an absolute path against it with new URL(path, host).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the $pageURLS computation in edit-ema-editor.component.ts and the createFullURL helper in utils/index.ts, then compare them with buildIframeURL in withEditor.ts. Verify the toolbar address bar and copy-url popover preserve a configured base path while still producing correct URLs for apps without one.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.