form-builder icon indicating copy to clipboard operation
form-builder copied to clipboard

Dynamic SelectOptionCollection does not work anymore in Neos 9

Open dlubitz opened this issue 1 year ago • 0 comments

If you want to use a dynamic SelectOptionCollection as value-label pairs for select options in Neos 9, this will be broken.

    // ...
    properties {
        options = Neos.Form.Builder:SelectOptionCollection {
            items = ${q(site).children('[instanceof Some.Package:NewsletterCategory]')}
            # we use the node identifier as value, we could use "name" or "label" instead for example
            valuePropertyPath = 'identifier'
        }
    }

Root cause is the SelectOptionCollectionImplementation which tries to fetch value and label with ObjectAccess::getPropertyPath directly from the object, which is a node in this case.

In Neos <9 the Node object had all properties as members, but this has changed in Neos 9

dlubitz avatar Nov 12 '24 13:11 dlubitz