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

Track and remove nested hidden fields #5805

Merged
merged 24 commits into from Apr 14, 2022

Conversation

jesseleite
Copy link
Member

@jesseleite jesseleite commented Apr 8, 2022

In #5101, we added tracking for hidden fields, so that users could use sometimes, required_if, etc. validation rules. That PR only handled fields at the top level though, and caused issues between nested fields and top level fields with the same handles. This PR adds proper handling of nested hidden fields.

  • Track and remove nested hidden fields on front end before submitting payload to server.
  • Ensure hidden field values (and nested hidden field values) are properly removed on PHP side before validating.
  • Refactor errorKey and errorKeyPrefix props/methods to fieldPath and fieldPathPrefix respectively.
    - We are now using error key for more than error handling, since those keys match payload structure.
  • Add test coverage.

@jesseleite jesseleite marked this pull request as ready for review April 14, 2022 18:06
@jasonvarga jasonvarga merged commit 4b6dd3c into 3.3 Apr 14, 2022
@jasonvarga jasonvarga deleted the track-and-remove-nested-hidden-fields branch April 14, 2022 21:50
buffalom pushed a commit to teamnovu/cms that referenced this pull request May 16, 2022
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Jason Varga <jason@pixelfear.com>
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

Successfully merging this pull request may close these issues.

Field with name "title" in replicator causes error for "main" title
3 participants