Skip to content

BUG: Selectbox editor with Entity-DataSource and set to multiple selection does not show selected entities #2771

Closed
@daniellienert

Description

Description

It is possible to receive entities via a DataSource and to select them in a SelectBox Editor. The selected entity is then saved to the property and the object is automatically dehydrated when the property is accessed.

That works fine when the inspector element is set to single-selection.

When the selector is configured with multiple: true, meant to save an array of references:

  • Selecting multiple entities work
  • The selection is successfully written to the database
  • After reload the selection is loaded from the database and passed as an array to the UI
    -> The entities are not displayed as selected in the multi-selectobox

Steps to Reproduce

  1. Configure references to an entity:
    user:
      type: array<Neos\Neos\Domain\Model\User>
      ui:
        label: Users
        reloadIfChanged: true
        inspector:
          group: file
          editor: Neos.Neos/Inspector/Editors/SelectBoxEditor
          editorOptions:
            placeholder: i18n
            dataSourceIdentifier: user-data-source
            multiple: true
  1. Configure a data type
Neos:
  Neos:
    userInterface:
      inspector:
        dataTypes:
          'array<Neos\Neos\Domain\Model\User>':
            typeConverter: Neos\Flow\Property\TypeConverter\TypedArrayConverter
            editor: 'Neos.Neos/Inspector/Editors/SelectBoxEditor'
            editorOptions:
              dataSourceIdentifier: 'user-data-source'
  1. Add a datasource

Expected behavior

After selecting users and saving the data, the selection is shown.

Actual behavior

After reload the selector stays empty

Affected Versions

Neos: latest

UI: latest

Metadata

Assignees

No one assigned

    Labels

    7.38.3BugLabel to mark the change as bugfixUI & UX

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions