Mismatching language configuration override values

Created on 26 February 2025, 2 months ago

Problem/Motivation

During the translation process, translatable configuration entries are extracted before sending them to a translator service.
When the configuration translation is populated from translated data , missing or non-existent entries are set to NULL in the config override, when dealing with traversable type data objects
from core ListElement .
From ElementInterface documentation it seems ambiguous to me at the point 'If the configuration values are the same as the source configuration, the override should be removed from the translation configuration.' which is not the case here, since the value is set to NULL, although it is unclear whether this refers to the method implementation.

This may cause an unintended change in the data structure,
Causing for instance that empty string values are replaced by NULL in case of traversable data objects, for instance the same reported at https://www.drupal.org/project/drupal/issues/3344026 🐛 Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\views\Plugin\views\PluginBase->viewsTokenReplace() Active , the same I found.

Steps to reproduce

1 - Configure a view page to list nodes (for example).
2 - Add a field of type Custom text and insert any "Text."
3 - Translate the view to any language via TMGMT using any provider that use the DefaultConfigProcessor and the source ConfigSource, for instance tmgmt_cdt.
4 - Access the view in the translated language, and a deprecation like this
Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\views\Plugin\views\PluginBase->viewsTokenReplace()
should be triggered.

This indicates a change in the value type that the configuration field was expecting.

Proposed resolution

Ensures that the translation configuration contains only valid values based on the source configuration comparing configuration structures before save language configuration override.

📌 Task
Status

Active

Version

1.0

Component

Source: Configuration

Created by

🇵🇹Portugal joao.ramos.costa

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024