craftcms / craftcms/cms

[4.x]: Characters limit double error messages

Open
#15,173 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug craft4
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

Hi,
I created a field with a limit set to 30 characters in the control panel.
On entry saved, it happens that I have two error message, depending of the characters' length, event when < 120

  • Error:Overline Title should contain at most 30 characters.
  • Error:Overline Title should contain at most 120 characters.

I try alsy after disabling all custom modules, and the result was the same.

Steps to reproduce
  1. Create an entry with a field limit 30
  2. Save the entry and check errors message below the field
Expected behavior

I expected to have only one error message.

Actual behavior

I have two error message

Craft CMS version

4.8.0

PHP version

8.1.27

Operating system and version

No response

Database type and version

mariadb 10.4

Image driver and version

No response

Installed plugins and versions
  • Agent agent marknotton/agent 5.0.0 Yes Yes
  • CKEditor ckeditor craftcms/ckeditor 3.8.3 Yes Yes
  • Comments comments verbb/comments 2.0.7 Yes Yes
  • Feed Me feed-me craftcms/feed-me 5.4.0 Yes Yes
  • Hyper hyper verbb/hyper 1.1.28 Yes Yes
  • Imager X imager-x spacecatninja/imager-x 4.4.0 Yes Yes
  • Navigation navigation verbb/navigation 2.0.27 Yes Yes
  • Retcon retcon mmikkel/retcon 2.7.5 Yes Yes
  • SEOmatic seomatic nystudio107/craft-seomatic 4.0.48 Yes Yes
  • Super Table super-table verbb/super-table 3.0.13 Yes Yes
  • View Count view-count doublesecretagency/craft-viewcount 1.2.3 Yes Yes
  • Workflow workflow verbb/workflow 2.0.9 Yes Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by creating an entry with a field limit of 30 characters and saving it, then inspect the validation path that produces the 30- and 120-character messages. Done means the field shows only one appropriate error message while the reproduction steps continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.