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

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Anybody created an issue. See original summary.

anybody’s picture

Issue summary: View changes
chizh273’s picture

Assigned: Unassigned » chizh273
chizh273’s picture

This issue is related to the \Drupal\commerce\Element\Conditions form element. I have created a parent issue in the commerce module.

UPD: I have created MRs for the parent issue.

rinasek’s picture

Status: Active » Fixed

Fixed within Commerce core

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.