-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix of saving "clone_field" fields #18160
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
…"clone_field" system config feature.
Hi @higi90. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
* @param array &$oldConfig Need for compatibility with _processGroup() | ||
* @param array &$extraOldGroups Need for compatibility with _processGroup() | ||
* @return string | ||
*/ | ||
private function getFieldPath(Field $field, array &$oldConfig, array &$extraOldGroups): string | ||
private function getFieldPath(Field $field, string $fieldId, array &$oldConfig, array &$extraOldGroups): string |
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.
I'm not sure that changing parameters order and adding a new parameter in the middle of the sequence a good idea. Current implementation will broke all usages of getFieldPath
method because array will be passed as second parameter instead of string.
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.
You're right, I agree with you. But in this case I think i can change the order of the parameters as I did because it is a private method. If it were anything else (protected or public) changing parameters order is of course, unacceptable. There are only 2 usages of the getFieldPath
method in Magento/Config/Model/Config
and I replaced them in the commit.
Hi @sidolov, thank you for the review. |
@higi90 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Hi @higi90. Thank you for your contribution. |
Thanks - this fix worked for us in v2.2.6 |
Description
After the Config model's refactoring, which came with released version 2.2.6, there was an error in storing the fileds which were created using "clone_field" feature. When the values were stored, the path was wrong and the values were stored under the wrong key.
E.g. when saving Product Image Placeholders.
Instead of expected values
catalog/placeholder/image_placeholder
,catalog/placeholder/ small_image_placeholder
,catalog/placeholder/swatch_image_placeholder
andcatalog/placeholder/thumbnail_placeholder
, all fields were saved to thecatalog/placeholder/ placeholder
.Manual testing scenarios
Contribution checklist