Replace LogicException with trigger_error in LangcodeRequiredIfTranslatableValues constraint

Created on 25 May 2024, 6 months ago
Updated 25 July 2024, 4 months ago

Problem/Motivation

When I try to arrange text formats and editors settings I get the following error.

Symfony\Component\Validator\Exception\LogicException: The LangcodeRequiredIfTranslatableValues constraint can only operate on the root object being validated. in Drupal\Core\Config\Plugin\Validation\Constraint\LangcodeRequiredIfTranslatableValuesConstraintValidator->validate() (line 26 of var/www/html/mysite/web/core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/LangcodeRequiredIfTranslatableValuesConstraintValidator.php).

This was caused by 🐛 Require `langcode: …` only for simple config that contains translatable values Active .

Steps to reproduce

On Drupal 10.3, edit and then save a text format that uses CKEditor.

Proposed resolution

Convert the LogicException to a E_USER_DEPRECATED error. This is a quick fix for sites broken by Drupal 10.3. Another fix for 11.x can be done in a follow-up.

Remaining tasks

Implement.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Text formats could not be saved due to config translation validation new in Drupal 10.3. The LogicException has been replaced with a E_USER_DEPRECATED error.

🐛 Bug report
Status

Fixed

Version

10.3

Component
CKEditor 5 

Last updated about 11 hours ago

Created by

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