Validation failing for required untranslatable field

Created on 14 July 2021, over 3 years ago
Updated 16 March 2024, 8 months ago

Problem/Motivation

On an existing site with content translation and content moderation (mandatory), if you change an existing field to required then you can no longer update your existing translations.

Steps to reproduce

1. On a translatable content-type add a 'Test date' date field that is not translatable and not required
2. Create a node, translate that node
3. Edit the "Test date" field configuration and set the field to required
4. Edit your translated node and hit save

The save will be blocked with a message that the "Test date" field is required even though it is not shown on the form. I have also tested the on EntityReference fields and they are also affected by the problem.

If you update your default language and populate the required date field then the translation can be updated. However, in the case of an entity reference you are not so lucky as it will WSOD with:
InvalidArgumentException: Value is not a valid entity. in Drupal\Core\Entity\Plugin\DataType\EntityReference->setValue() (line 106 of core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php).

Proposed resolution

TBD

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Content translation 

Last updated about 17 hours ago

No maintainer
Created by

🇨🇦Canada joel_osc

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024