Problem Statement
The legacy "Select a Page" / "Select a file" browser dialog used by classic (old edit mode) custom fields — for example the bundled redirect_custom_field_old.vtl template — never returns any Pages, even when live/published pages exist. The dialog opens correctly and renders the site/folder tree, but the content pane always shows "No files found" for every folder, including a site's root with a guaranteed published index page.
This affects any customer using a custom field (VTL) built on dotcms.dijit.FileBrowserDialog with mimeTypes="application/dotpage" to let editors pick a Page — the picker is 100% non-functional; there is no workaround short of manually typing the page's URL.
Root cause: The dialog is configured with mimeTypes="application/dotpage":
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/redirect_custom_field_old.vtl (line 40)
That value flows: BrowserAjax.getFolderContent(...) builds a BrowserQuery.showMimeTypes(["application/dotpage"]) (dotCMS/src/main/java/com/dotmarketing/portlets/browser/ajax/BrowserAjax.java, ~lines 395-409) → BrowserAPIImpl.getFolderContent() → getContentUnderParentFromDB() → selectQuery() → appendMIMETypeQuery() (dotCMS/src/main/java/com/dotcms/browser/BrowserAPIImpl.java, lines 2158-2163):
private void appendMIMETypeQuery(final StringBuilder sqlQuery, final List<String> mimeTypes) {
final String mimeTypesFilter = String.format(" AND (%s)", mimeTypes.stream()
.map(mimeType -> String.format("jsonb_path_exists(c.contentlet_as_json,'$.fields.**.metadata ? (@.contentType like_regex \".*%s.*\")')", mimeType))
.collect(Collectors.joining(" OR ")));
sqlQuery.append(mimeTypesFilter);
}
This checks whether a binary field's stored metadata has contentType matching the requested MIME type. "application/dotpage" is not a real, persisted value anywhere in a Page Contentlet's contentlet_as_json — it is a synthetic label invented only when building the JSON response sent back to the browser, in BrowserAjax.java (~line 788): pageMap.put("mimeType", "application/dotpage");. That assignment happens client-response-side, after the SQL query already ran, and is also used by a separate, harmless in-memory filterReturnList check — it is never written back into any contentlet's actual stored metadata.
Since Pages (post "HTML Page as Content" refactor — see Task03100HTMLPageAsContentChanges.java) have no binary field at all, jsonb_path_exists(...) can never evaluate true for a Page row. appendMIMETypeQuery therefore unconditionally excludes every Page from the SQL result set whenever mimeTypes=["application/dotpage"] is requested — regardless of publish state, permissions, host, or folder. This is a structural mismatch between a synthetic display-only label and a real DB-level filter, not a data or configuration problem.
Steps to Reproduce
- On a content type with a custom field built on the bundled
redirect_custom_field.vtl template (or any custom field/VTL that opens dotcms.dijit.FileBrowserDialog with mimeTypes="application/dotpage"), open the content edit form in classic/old edit mode.
- Click the field's "Select a Page" button to open the file browser dialog.
- Navigate to any site root or folder that has at least one published (live) Page — e.g. the site's index page.
- Expected: the live Page(s) under that folder appear in the results list, selectable.
- Actual: the folder tree renders correctly (site/folder navigation works), but the content pane always shows "No files found" — no Pages are ever listed, even the guaranteed-published root index page.
Acceptance Criteria
dotCMS Version
26.06.04-01
26.06.22-02
Severity
High - Major functionality broken
Links
Problem Statement
The legacy "Select a Page" / "Select a file" browser dialog used by classic (old edit mode) custom fields — for example the bundled
redirect_custom_field_old.vtltemplate — never returns any Pages, even when live/published pages exist. The dialog opens correctly and renders the site/folder tree, but the content pane always shows "No files found" for every folder, including a site's root with a guaranteed published index page.This affects any customer using a custom field (VTL) built on
dotcms.dijit.FileBrowserDialogwithmimeTypes="application/dotpage"to let editors pick a Page — the picker is 100% non-functional; there is no workaround short of manually typing the page's URL.Root cause: The dialog is configured with
mimeTypes="application/dotpage":dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/redirect_custom_field_old.vtl(line 40)That value flows:
BrowserAjax.getFolderContent(...)builds aBrowserQuery.showMimeTypes(["application/dotpage"])(dotCMS/src/main/java/com/dotmarketing/portlets/browser/ajax/BrowserAjax.java, ~lines 395-409) →BrowserAPIImpl.getFolderContent()→getContentUnderParentFromDB()→selectQuery()→appendMIMETypeQuery()(dotCMS/src/main/java/com/dotcms/browser/BrowserAPIImpl.java, lines 2158-2163):This checks whether a binary field's stored metadata has
contentTypematching the requested MIME type."application/dotpage"is not a real, persisted value anywhere in a Page Contentlet'scontentlet_as_json— it is a synthetic label invented only when building the JSON response sent back to the browser, inBrowserAjax.java(~line 788):pageMap.put("mimeType", "application/dotpage");. That assignment happens client-response-side, after the SQL query already ran, and is also used by a separate, harmless in-memoryfilterReturnListcheck — it is never written back into any contentlet's actual stored metadata.Since Pages (post "HTML Page as Content" refactor — see
Task03100HTMLPageAsContentChanges.java) have no binary field at all,jsonb_path_exists(...)can never evaluate true for a Page row.appendMIMETypeQuerytherefore unconditionally excludes every Page from the SQL result set whenevermimeTypes=["application/dotpage"]is requested — regardless of publish state, permissions, host, or folder. This is a structural mismatch between a synthetic display-only label and a real DB-level filter, not a data or configuration problem.Steps to Reproduce
redirect_custom_field.vtltemplate (or any custom field/VTL that opensdotcms.dijit.FileBrowserDialogwithmimeTypes="application/dotpage"), open the content edit form in classic/old edit mode.Acceptance Criteria
redirect_custom_field_old.vtl) on any folder containing at least one live Page returns that Page in the results listdotCMS Version
26.06.04-01
26.06.22-02
Severity
High - Major functionality broken
Links