-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix default values not being properly loaded for ArraySerialized fields #6231
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
Conversation
…model \Magento\Config\Model\Config\Backend\Serialized\ArraySerialized.
Hi @mimarcel We watch on this code from another side:
This amendments will allow to use serialized data in config.xml file or in another source. Thanks, Sergii |
@sereban in which Magento version will the new fix be included? |
@mimarcel please look how this implemented in 2.2 It should meet your needs |
@maghamed the issue persists in 2.2, as described in Steps to Replicate.
is not called when configuration value is taken from config.xml directly. |
@marcel-moldovan-vm @mimarcel you should define backend model in config.xml
Magento\Config\Model\Config\Backend\Serialized should implement \Magento\Framework\App\Config\Data\ProcessorInterface (will be in 2.2.1) |
@viktym setting the backend model in config.xml is a good hint, but it does not fix the issue. |
@mimarcel please check 86d46ce and 6c9a8b2. With these changes serialized config data should be properly displayed at Admin Panel. But to use persisted config value it should be deserialized as scope config will return serialized string. We can not modify such behavior of serialized config data due to backward compatibility.
Please note that now changes available only in If this approach suitable for you we will be thankful for a backporting solution to |
Preconditions:
Bug:
Default values are not properly loaded for fields with backend model \Magento\Config\Model\Config\Backend\Serialized\ArraySerialized.
How to replicate:
Example system.xml:
Example acl.xml:
Example:
Expected: default value is loaded

Actual: default value is missing because afterLoad was not called on backend model when configuration existed ONLY as default value in config.xml

Notes: