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

Validation errors trickle down replicator #11286

Open
robdekort opened this issue Dec 19, 2024 · 3 comments
Open

Validation errors trickle down replicator #11286

robdekort opened this issue Dec 19, 2024 · 3 comments

Comments

@robdekort
Copy link
Contributor

Bug description

In this page builder, you can see there's a validation error in a certain set. When I delete that set, the error trickles down to the next set in the replicator field.
2024-12-19 10 12 39

How to reproduce

  1. Create a replicator
  2. Cause a validation error in set 1
  3. Remove set 1
  4. See the validation error trickle down to set 2
  5. And so forth

Logs

No response

Environment

Environment
Application Name: Care About IT
Laravel Version: 10.48.25
PHP Version: 8.2.26
Composer Version: 2.8.3
Environment: local
Debug Mode: ENABLED
URL: careaboutit.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Locales
Installed
Locales Version: 1.9.0
Protected

Localization
Installed: en, nl
LaravelLang\Attributes\Plugin: 2.11.2
LaravelLang\HttpStatuses\Plugin: 3.8.5
LaravelLang\Lang\Plugin: 13.12.0
Protected Locales: en
Publisher Version: 14.7.1

Livewire
Livewire: v3.5.17

Statamic
Addons: 5
Sites: 3 (English, Finnish, Dutch)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.44.0 PRO

Statamic Addons
jonassiewertsen/statamic-livewire: 3.8.1
studio1902/statamic-peak-browser-appearance: 3.6.0
studio1902/statamic-peak-commands: 2.7.0
studio1902/statamic-peak-seo: 7.5.0
studio1902/statamic-peak-tools: 3.4.3

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@duncanmcclean
Copy link
Member

Related to #10704 (which is the same issue, but for the Grid fieldtype)

@jasonvarga
Copy link
Member

Seems about right. Nested validation is defined on an index. So when you delete a set, the next one takes its place at that index.

I don't really see a way around this except for removing validation messages when you interact with a field.

Or some sort of complex system of tracking the indexes when validation happens.

<replicator-set
  :index="1"
  :index-at-most-recent-validation-request="1"
/>

It's right but also definitely very not right. 😄

Probably fixable but don't know how soon.

@robdekort
Copy link
Contributor Author

Haha, yeah, I guess just clearing the validation might be the easiest way around this?

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

No branches or pull requests

3 participants