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

[4.x] Improve array fieldtype validation for dynamically keyed fields #9834

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

jesseleite
Copy link
Member

I noticed this little oddity when working on #9632, since we use array fieldtype in new sites configuration UI.

Before this PR, if you try to save a publish form with an array fieldtype that is set to dynamic mode, if you leave an empty key or value, you get weird data saved to your yaml:

dynamically_keyed_array:
  foo: Bar
  'null': null

If you use keyed or single modes, key and value are both required for each submitted row. This PR adds validation to ensure you properly fill out each row.

CleanShot 2024-04-05 at 16 25 05

@jesseleite jesseleite mentioned this pull request Apr 5, 2024
33 tasks
@jasonvarga jasonvarga merged commit 76230a1 into 4.x Apr 8, 2024
36 checks passed
@jasonvarga jasonvarga deleted the improve-arr-fieldtype-valiation branch April 8, 2024 14:11
duncanmcclean added a commit that referenced this pull request Jun 19, 2024
These rules were ensuring all options had keys.

Since these rules were added, #9834 was merged, which added key validation to the base array fieldtype.
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.

2 participants