You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit: should have started with this, but I picked apart a request in my actual project just now, and realized the empty + hidden field is actually being included in the payload. Maybe that's the issue—that a hidden field is being passed through in the first place, for the custom fieldtype config? 🤔
When building out the configFieldItems in a custom field, I think any (but at minimum the numeric) fieldtypes that have an inherent/preset $rules, together with a user-defined sometimes validation rule, will always throw errors (when they're not submitted). Pretty sure the preset $rules, in this context, is overriding or taking precedence over (ie, evaluated before) the sometimes rule. From Floatval, for example:
I initially thought this was related to nested fields (ie, in a Replicator)—hence that setup in the blueprint. Left it in there because it does also impact nested numerics...but it's not specific to that context, which is why I didn't emphasize it above.
Let me know if there's anything else I can do to help, here!
The text was updated successfully, but these errors were encountered:
Bug description
Edit: should have started with this, but I picked apart a request in my actual project just now, and realized the empty + hidden field is actually being included in the payload. Maybe that's the issue—that a hidden field is being passed through in the first place, for the custom fieldtype config? 🤔
When building out the
configFieldItems
in a custom field, I think any (but at minimum thenumeric
) fieldtypes that have an inherent/preset$rules
, together with a user-definedsometimes
validation rule, will always throw errors (when they're not submitted). Pretty sure the preset$rules
, in this context, is overriding or taking precedence over (ie, evaluated before) thesometimes
rule. FromFloatval
, for example:Here's a repo that reproduces the issue, and a screencap of what this looks like with a bit of code + CP interface:
How to reproduce
Field with Replicator Field
(at the bottom)Root Toggle
Sometimes Float Field
FieldWithReplicator.php
, line 17, to make sure I'm not missing something obvious. 😬Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
I initially thought this was related to nested fields (ie, in a Replicator)—hence that setup in the blueprint. Left it in there because it does also impact nested numerics...but it's not specific to that context, which is why I didn't emphasize it above.
Let me know if there's anything else I can do to help, here!
The text was updated successfully, but these errors were encountered: