Geocoder field can break creating of the content translation.

Created on 22 December 2023, 6 months ago

Problem/Motivation

There is a case when we are not able to create a content translation because of geocoder field
We receiving an error Non-translatable fields can only be changed when updating the original language.

Steps to reproduce

  • The site must be multilingual
  • Create two fields: Geolocation and Address
  • Geolication field should not be translatable ("Users may translate this field" is unchecked)
  • For Geolocation field configure 'Geocode from an existing field' option. Set Address field there
  • Select a native 'Geolocation Lat/Lng' widget for the Geolocation field
  • Create a new content and fill in the address.
  • After saving Lat and Lng of the Geolocation field will be set automatically.
  • Try to create a translation of this content
  • The error Non-translatable fields can only be changed when updating the original language. will be appear

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @HitchShock
  • Status changed to Needs review 6 months ago
  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

    The issue is caused by 'data' value
    Dumper returns value with 'data' property and it saves in the field.
    But when we try to create a new translation and the address isn't changed, then 'data' property of the field value will be empty and EntityUntranslatableFieldsConstraintValidator determines this case as changing the field and returns an error.

    We need to unset 'data' property to prevent such cases.

Production build 0.69.0 2024