Allow for labels longer than 255 characters

Created on 23 October 2020, over 4 years ago
Updated 30 August 2024, 7 months ago

Problem/Motivation

We want to use the Automatic Entity Label module for an entity with a label that has and must have more than 255 characters.

However, a limit of 255 characters is hard-coded in this module, in AutoEntityLabelManager.php.

Proposed resolution

I have a simple fix for that problem: Try to obtain the length of the label field from the field settings. Only if that fails for whatever reason, fall back to a default length of 255.

You find the fix in this commit of my - kind of - fork of the project:
https://github.com/philippze/auto_entitylabel/commit/7c27a2b0dbbc94ddb58...

I have also attached a patch file with the same changes.

Remaining tasks

Could you please apply the proposed little change?

Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

🇮🇹Italy philippze

Live updates comments and jobs are added and updated live.
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.

  • 🇩🇪Germany Anybody Porta Westfalica

    Could this please be turned into a MR?

  • First commit to issue fork.
  • Merge request !32Update AutoEntityLabelManager.php → (Open) created by dqd
  • Status changed to Needs review 7 months ago
  • 🇫🇷France dqd London | N.Y.C | Paris | Hamburg | Berlin

    Needs review with one question I still have in mind: Why we set 255 chars as default when we call field settings anyway? Wouldn't fetching field settings be enough? The default would be 255 neither then if not changed. I just copied the original patch into MR one to one for reference and credits to the original author. But possible optimizations can be discussed now.

Production build 0.71.5 2024