Problem/Motivation
When translation is enabled for Shipping methods with "Hide non translatable fields on translation forms" enabled
(at /admin/config/regional/content-language) - which is typically what you want for UX when translating. then the configured settings of the hidden fields are completely wiped when saving the translation.
This means that even in the original language all settings are empty after saving the translation!
I guess it's because you have to select Plugin to be translatable, to be able to translate all the fields.
There must be something wrong in the code around the translation logic, which is missing to consider this setting.
I think this is at least major, if not critical, as you lose all the shipping configration without noticing it and in fact have a totally wrong (empty) shipping configuration after translation.
Steps to reproduce
See above
Proposed resolution
Find the bug in code, where the "hidden" option from above is not handled correctly. Ensure that the hidden field values are preserved.
As a quickfix it might be possible to disable the checkbox to hide these fields and use an update hook to uncheck this option and warn the user, if set somewhere
By the way, the issue could be mitigated if the shipping methods were revisionable, see #3419981: Make shipping methods revisionable to track changes
Comments
Comment #2
anybodyComment #3
chizh273 commentedComment #4
chizh273 commentedThis issue is related to the
\Drupal\commerce\Element\Conditionsform element. I have created a parent issue in thecommercemodule.UPD: I have created MRs for the parent issue.
Comment #5
rinasek commentedFixed within Commerce core