Open robdekort opened 9 months ago
I think the other times where sometimes
doesn't work might have to do with imported fieldsets and using prefixes. Which is a separate issue. I'll try to narrow this down and report another one.
Are you able to reproduce this in an entry (since you can't create form submissions in the cp) and see if the same thing happens in the control panel publish form?
Hey Jason, I couldn't replicate this specific issue in the backend. It seems to work fine there.
This is the form with precognition, right?
My guess is that the $form
is initialized with all the data, so it gets submitted.
The conditional logic needs to be able to remove it from that object when the field is hidden. Neat.
Yeah that sounds like it. I used to run into this when I submitted with Ajax myself as well btw.
I'm encountering this bug when using forms in a Navigation blueprint in the backend. The fields are hiding / showing conditionally as expected, but sometimes
doesn't appear to be respected and is causing every field to be validated even when a lot aren't shown. I'm not using any fieldsets or prefixes as mentioned above. I can provide more details if necessary, but my Statamic version is 5.19, and I'm using Eloquent Driver 4.12 for storing entries on MacOS.
Here's a link to the discord thread which details the issues I was having.
This is also happening with the user creation wizard and custom fields that are required + sometimes and conditionally hidden. Link to discord
Bug description
I've found that validating something as required sometimes doesn't always work. If it doesn't it triggers a required field validation even when the field isn't visible. Using
required_if
instead is a way to work around this.I've ran into this on multiple occasions, but didn't jot them down and I can only replicate the issue in Forms today. I'll report the other scenarios as soon as I run into them again.
https://github.com/statamic/cms/assets/69107412/88f14902-a4db-404f-a7ac-7521c4cb46c9
In this clip the I'm conditional field shouldn't trigger a validation error when the name field isn't
Rob
.How to reproduce
Logs
No response
Environment
Installation
Starter Kit using via CLI
Antlers Parser
None
Additional details
No response