Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Store select / multiselect] Support getOptions() via option provider #1773

Conversation

BlackbitDevs
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no

Currently it is not possible to fetch the available options for store select / multiselect field types as you would normally do for Pimcore default select / multiselect fields via

$object->getClass()->getFieldDefinition('store')->getOptions(); // returns always null
DataObject\Service::getOptionsForSelectField($object, "store"); // also returns always null

This is currently always null as the logic for fetching the available options is only implemented in JS, see

and

It works currently only because Pimcore does not check if the set option is actually available in Select::checkValidity() / Multiselect::checkValidity() in https://github.com/pimcore/pimcore/blob/d0b5dc0d78392ee2d4012d228214901fd1080076/models/DataObject/ClassDefinition/Data/Select.php#L373
But this may change and nevertheless it is a good idea to support the same logic like Pimcore's default field types do.

@BlackbitDevs BlackbitDevs changed the title [Store select / multiselect] Support getOptions() for via option provider [Store select / multiselect] Support getOptions() via option provider Nov 9, 2021
@dpfaffenbauer dpfaffenbauer added this to the 3.0.0 milestone Nov 9, 2021
@dpfaffenbauer dpfaffenbauer merged commit 176b55a into coreshop:master Nov 9, 2021
@dpfaffenbauer
Copy link
Member

PSALM is failing for other reasons. Interesting that it does that all the time. it passes and a bit later finds new issues :/.

But has nothing todo with your pr. so thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants