Wrong maxlength on Authored By field for translation

Created on 9 September 2024, 3 months ago
Updated 20 September 2024, 3 months ago

Problem/Motivation

username has a character limit of 60. If we create a user with name of 58 or 59 characters and try to translate a content, translation will not get saved. However on creating or editing a content in original language, it gets saved.

In authoring information tab (in node add, edit), 'Authored by' has maxlength 1024. Only in translation form, Authored by inside translation tab has maxlength 60. In the same translation form, Authored by field inside 'Authoring information' tab has maxlength 1024 and this causes issue.

The ContentTranslationHandler adds an entity_autocomplete field with a maxlength of 60 characters to the node edit form. The intent is probably to match the value in use on the UserInterface::USERNAME_MAX_LENGTH. However the autocomplete selection adds the (nid) to the selected username. If the value is greater than the limit it prevents submit the node edit form.

Steps to reproduce

Set a entity type as translatable. Create a user with a very long username (ex: 59 characters).
Create an entity with this user and save it.
Create a translation and try to save it.

Proposed resolution

Remove the maxlength attribute on the field.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Content translation 

Last updated 2 days ago

No maintainer
Created by

🇫🇷France GuillaumePacilly

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

Production build 0.71.5 2024