Error saving node with field as token

Created on 26 January 2022, over 3 years ago
Updated 1 March 2023, about 2 years ago

Problem/Motivation

In the autotitle configuration I have set the title to be generated automatically through the token of another field that is inside my node. That field is of type Formatted Long Text.

When I create a node and fill that field, which has more than 255 characters, when I press save it gives a database error, because the title field that is filled in automatically only admits 255 characters.

Steps to reproduce

The steps to reproduce the error are as follows.
1. In the content type configuration of the entity in which we are configuring autotitle, activate autotilte,
2. In "Fallback title" put the token of a field of the Long text type with format (more than 255 cha).
3. Go to Content/Add Content and we create a node for the entity in which we have configured autotitle.
4. Click on the save button.
5. The error appears.

Proposed resolution

Before saving the title field in the database, trim the field to 255 characters, which is the maximum that the title field admits in the database.

🐛 Bug report
Status

Fixed

Version

1.2

Component

Code

Created by

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

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