Skip to content

[Studion UI] TypeError: e is not iterable when adding the first option to a Select field with no configured options (class editor) #260

Description

@elements-team

Affected Version

2026.2

Affected capability

Data Objects

Steps to reproduce

  1. Open the class editor (Data Management → Data Model Definitions → Classes) for any class that has a select datatype field whose options were never configured
  2. Select the field in the tree, scroll to Specific Settings → Select Options. The grid shows "No data available yet."
  3. Click the Add button above the grid to add the first option row.

Actual Behavior

The browser console throws:

TypeError: e is not iterable
    at Object.addRow (__federation_expose_app.<hash>.js:3356:1401)
    at Object.onClick (__federation_expose_modules__field_definitions.<hash>.js:6:28310)
    ...

No row is added; the grid remains empty and the field cannot be given any options through the UI.

Root cause

  • The class-definition API (GET /pimcore-studio/api/class/definition/configuration-view/detail/{id}/layout) serializes the field's options as null (not []) when no options have ever been set:
    {"name":"status", ..., "options":null, ...}
  • The frontend addRow handler appears to spread/iterate the current options value directly (something like [...currentOptions, newRow]) without guarding against null, which throws TypeError: e is not iterable instead of treating a missing/null value as an empty array.

Workaround

Manually edit the class definition export (var/classes/definition_ClassName.php) and change the field's

'options' => NULL,

to

'options' =>
  array (
  ),

then clear the Symfony cache. After that, the API returns "options":[] and the Add button works normally.

Suggested fix

Either:

  • Have the backend serialize options as [] instead of null when empty (defensive default at the ClassDefinition\Data\Select model level), and/or
  • Guard addRow (and any other place that spreads/iterates options) against a null/undefined value on the frontend

Expected Behavior

A new empty, editable option row is added to the grid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Platform Version

    2026.2

    Affected capability

    Data Objects

    Galaxy

    None yet

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions