neos / form-builder

Flow Form Framework integration into Neos CMS
GNU General Public License v3.0
18 stars 31 forks source link

Dynamic SelectOptionCollection does not work anymore in Neos 9 #143

Open dlubitz opened 3 days ago

dlubitz commented 3 days ago

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