question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] `repeatable` subfield error messages are a bit odd

See original GitHub issue

Bug report

What I did

Made a repeatable subfield required (using nested array validation, present in 4.2).

What I expected to happen

Nice error message when “quantity” subfield is missing.

What happened

Screenshot 2022-01-18 at 11 28 48

I wonder if there’s anything we can do to

  • turn The items.0.quantity field is required
  • into the item quantity field is required for row 0

Or… I don’t know… maybe even something better than that. At least a way to tell people "define this in your FormRequest’s messages().

What I’ve already tried to fix it

Nothing. In a rush to ship 4.2.

Is it a bug in the latest version of Backpack?

4.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pxpmcommented, Mar 21, 2022

@niladam for a field you validate with: 'repeatable.*.field_name'=> 'required' you can put in your messages: repeatable.*.field_name.required => 'this field is required'.

The PR that works on this is: https://github.com/Laravel-Backpack/CRUD/pull/4220/files but is mainly so that you can validate directly on the fields with validationRules => 'required' and it will process it to be usable in a FormRequest. . For a FormRequest validation is standard laravel nested input validation https://laravel.com/docs/9.x/validation#validating-nested-array-input

0reactions
pxpmcommented, Aug 30, 2022

I think this is done. 👍

I’ve just tested repeatable messages and everything is displaying correctly.

This was a misunderstanding on how to display repeatable messages.

I am closing this, please re-open if you guys think I am wrong.

Cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Control Subfields - OCLC
Definition. The subfields included here are used to provide various identifiers, relationships, and sources of terms and codes.
Read more >
Bug 28445: Use the task queue for the batch delete ... - Koha
To use with items_table_batchmod BLOCK (still from html_helpers.inc) This patch is fixing some bugs about repeatable subfields and regex.
Read more >
Chapter 3. Data, Tables, and Database Design - O'Reilly
The essence of data normalization is just this: pull out repeating and ... to put data into it, Access gave me a "primary...
Read more >
Understanding MARC Bibliographic: Parts 7 to 10
For full listings of all MARC 21 tags, indicators, and subfield codes, see MARC 21 ... If it can only be used once,...
Read more >
Authority toolkit: create and modify authority records
(The toolkit will attempt to assign the appropriate subfield code, and will ... The toolkit does something that may seem a bit unusual...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found