[Store select / multiselect] Support getOptions() via option provider #1773
+78
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
This is currently always
null
as the logic for fetching the available options is only implemented in JS, seeCoreShop/src/CoreShop/Bundle/StoreBundle/Resources/public/pimcore/js/coreExtension/tags/coreShopStoreMultiselect.js
Line 17 in 99bbb0c
CoreShop/src/CoreShop/Bundle/ResourceBundle/Resources/public/pimcore/js/coreExtension/tags/multiselect.js
Line 23 in 99bbb0c
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#L373But this may change and nevertheless it is a good idea to support the same logic like Pimcore's default field types do.