Skip to content

[Studio] Allowed-classes select in class editor shows duplicate options and drops classes (folder nodes leak into options) #239

Description

@alexbaat

Affected Version

2026.2

Affected capability

Data Objects

Steps to reproduce

  1. Create data object classes Material, MaterialGroup and Series — none of them with an explicit group set.
  2. Add a manyToOneRelation (or any other relation type) field to a class and open its settings in the Studio class editor.
  3. Open the Allowed classes select.

Actual Behavior

  • The dropdown contains duplicate entries: Material appears twice — once for the real class and once for the group/folder node that ClassDefinitionTreeService derives from the class-name prefix (Material + MaterialGroup → folder named Material). Same for any other prefix collision (e.g. Product/ProductForm).
  • Phantom entries appear for group names that are not classes at all (e.g. Royalty for RoyaltyCollector/RoyaltyCost).
  • The duplicate option values break rendering of the virtualized dropdown, so valid classes such as Series no longer show up and cannot be selected as allowed class.
  • A folder/group name can be selected and saved as "allowed class" even though no such class exists.

Root cause: useClassDefinitionOptions (studio-ui-bundle, assets/js/src/core/modules/field-definitions/dynamic-types/hooks/use-class-definition-options.ts) fetches the class definition tree with withGroup: true and its flattenTreeNodes() emits the folder (group) nodes themselves as selectable options in addition to their children. The hook is used by all six relation field types.

Reproduced on v2026.1.6, still present on 2026.x / v2026.2.1.

Expected Behavior

The allowed-classes select lists every data object class exactly once and never offers group/folder names as selectable values.

Fix provided in PR: pimcore/studio-ui-bundle#3930

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

Affected capability

Data Objects

Platform Version

2026.2

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions