-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
bin/magento config:set expects config path to match display path #27678
Comments
Hi @navarr. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @navarr do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
I could also add that there's another scenario that's not covered now. |
@igrybkov Good call out. Both use cases would be fixed if config.xml was more definitive than system.xml |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions. |
bump |
✅ Confirmed by @engcom-Alfa Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Summary
We're updating our configuration to be more user friendly and this involves creating new categories to move configuration around. While doing this, we want to maintain backwards compatibility and so have set config_paths for most of our settings.
An example would be
tax/vertex_settings/trustedId
is now in system.xml astax/vertex/connection/trusted_id
- but has config_path set totax/vertex_settings/trustedId
. This field has a backend model to encrypt the data in it.The problem being experienced is that the data is being entered into the database unencrypted - leading it to be considered encrypted and then the code receiving junk data.
This is occurring because the
config:set
command pulls apart the path and sends it as if that were the path being sent by the form.So when we enter
Magento\Config\Model\Config
our$groupPath
istax/vertex_settings
and our$groupData
is['fields' => ['trustedId' => ['value' => '<value>']]]
.It SHOULD be:
groupPath
=tax/vertex/connection
groupData
=['fields' => ['trusted_id' => ['value' => '<value>']]]
One might then try to run
config:set tax/vertex/connection/trusted_id <value>
however this returns that the config does not existManual testing scenarios (*)
bin/magento config:set sales/general/keyid 1
We can see Value was saved. as expected.
config_path
tosystem.xml
like thisconfig
bin/magento config:set sales/general/keyid 777
Actual Result:
The "sales/general/keyid" path doesn't exist. Verify and try again.
Expected Result:
Value was saved.
Proposed Solution
Update
Magento\Config\Model\Config\PathValidator
to check if an element exists by the path presented to it, and if it has a config path, use that instead for validation.Inserting into the top of the validate command:
This is my proposed solution over trying to determine the display path via the config path, as more than one display path can have the same config path. This change would then allow
config:set tax/vertex/connection/trusted_id
(and other "display paths")The text was updated successfully, but these errors were encountered: