Tabbed field items cause database errors with long titles

Created on 27 April 2023, about 1 year ago

Problem/Motivation

Because the tabbed item sets a limit on the title column in the database schema, but does not enforce that limit in the widget (because that uses the max_length setting in stead of 255), users can cause a database error by setting the max_length setting of the field higher than 255 and inputting a title with more than 255 characters.

Proposed resolution

There are 2 possible solutions is can see:

  1. Change the maxlength of the title field in the widget to 255
  2. Update the schema for the title field so it can handle more than 255 characters

Because of this field possibly being used in layout builder, which can save the state of the title fields with more than 255 characters, the first option might cause a bit more friction.

I think the tabbed item field could use a bit more refactoring in general, but that might just be my opinion.

πŸ› Bug report
Status

Active

Version

6.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium L_VanDamme

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

Comments & Activities

  • Issue created by @L_VanDamme
  • πŸ‡§πŸ‡ͺBelgium L_VanDamme

    Uploading a patch I used for a project that implements the second possible solution (updating the database schema), because they specifically wanted to be able to use longer titles.

    This patch was made on the 6.0.0-alpha38 version of this module, but should work on later versions as well.

Production build 0.69.0 2024