Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message for empty repeater field entry #2295

Open
nestordedios opened this issue Feb 18, 2025 · 2 comments
Open

Incorrect error message for empty repeater field entry #2295

nestordedios opened this issue Feb 18, 2025 · 2 comments

Comments

@nestordedios
Copy link

Describe the bug

When a repeater field in Formie is left empty, the error message displayed is:

"Repeater field label 0 Field label can not be empty."

This message is unclear and seems to include unnecessary elements like "Repeater field label 0", "Repeater field label 1", "Repeater field label 2" and so on. A more user-friendly message would be something like:

"Field label can not be empty." 

So in my use case I would expect the error to be Name can not be empty.

I don't know wether if this is a real bug or the fields need to be configured in a specific way. Is there a way to show a different error message on Repeater fields?

Steps to reproduce

  1. Add a repeater field with a required subfield (e.g., a "Single-line text" field).
  2. Render the form and add a Single-text subfield
  3. Leave the subfield empty
  4. Submit the form without
  5. Observe the error message

.Image

Form settings

  • Multi-page form: Yes
  • Submission Method: Page Reload
  • Client-side Validation: No
  • Custom Form Templates: Yes

Craft CMS version

5.6.6

Plugin version

3.0.20

Multi-site?

No

Additional context

No response

@engram-design
Copy link
Member

This is more down to how we resolve the labels for fields in validation, when nested. This was changed slightly recently to fix some other fields with related issues.

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.20".

@nestordedios
Copy link
Author

Thank you for the quick fix @engram-design !

I have updated and the fix is now working 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants