Skip to content

[DEFECT] UVE Content Palette: "Sort by Most Popular" shows least-used content types first #35848

@Neehakethi

Description

@Neehakethi

Summary

In the UVE page editor, the Content Palette → Sort by Most Popular option displays content types in reverse order — the least-used types appear at the top, and the most-used types sink to the bottom.

Freshdesk ticket: https://dotcms.freshdesk.com/a/tickets/37541


Environment

  • Affected versions: dotEvergreen (confirmed in source; likely affects all versions since the Content Palette redesign in PR feat(UVE): Redesign Content Palette #33660)
  • Deployment: Cloud (dotEvergreen); expected to affect self-hosted as well
  • Area: UVE → Content Palette → Sort dropdown → "Most Popular"

Steps to Reproduce

  1. Open any page in the UVE editor
  2. Open the Content Palette (left panel)
  3. Click the sort icon / sort menu
  4. Select "Most Popular"
  5. Observe the order of content types shown

Expected Behavior

Content types with the highest number of existing contentlets appear at the top — i.e. the types editors use most frequently are easiest to find.


Actual Behavior

Content types with the lowest number of contentlets appear at the top. The sort is inverted — effectively showing "Least Popular" first.


Root Cause

The "Most Popular" menu item in the Content Palette hardcodes direction: 'ASC', but ASC on a usage-count sort produces ascending (lowest → highest) order.

File: core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/components/dot-uve-palette/utils/index.ts (~line 115)

// Current (wrong) — ASC = least used first
{
    label: 'uve.palette.menu.sort.option.popular',
    command: () => onSortSelect({ orderby: 'usage', direction: 'ASC' }),
}

The backend (ContentTypeResource.java:2058–2066) sort logic is correct — DESC produces highest-count-first. The fix is entirely in the frontend.

Fix: Change direction: 'ASC'direction: 'DESC' for the popular sort option.


History

Introduced in PR #33660 (Content Palette redesign), closing Epic #32640.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions