-
Notifications
You must be signed in to change notification settings - Fork 9.4k
9742: Default welcome message returns after being deleted #9742 #12328
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
Hi @RomaKis, there is no bug with configuration persistence, you can save empty welcome message, field is empty in db (screenshot added). Issue caused by incorrect form data population (fallback to default value) in \Magento\Theme\Model\Design\Config\DataProvider\MetadataLoader::getData() method. |
Hi @sidolov, the bug is that they are not empty in backend. When you tried to delete it and save. It will reappear after save. |
@RomaKis after clean Magento installation records about welcome message and copyrights are absent on db. They will be created if saved values were different then default. It's expected result that empty values stored in db as null, doesn't make sense store empty strings, we don't consider this to be a good design. Described problem exists only on backend form, frontend works as expected, so, issue should be fixed in form data population flow (for example system configuration show empty values correctly). |
@sidolov, ok, I agree with you. I change code. Please, review it again. |
if ($value !== null) { | ||
$fieldData->setValue($value); | ||
|
||
if ($value == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use strict comparison
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sidolov, done.
|
||
if ($value === null) { | ||
$value = ''; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove blank line at end of control structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sidolov, done and squashed.
Default welcome message returns after being deleted #9742
Description
Column value in core_config_data was nullable. When we saved '' as column was nullable in lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php line 3001 the value became null, so it was null in db. If value is null it will take the default value, so we couldn't save '' and see '' at the form.
Now column value isn't nullable, so when we save '' it will save in db as '' and show at the form as ''.
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist