Skip to content

New ::submit method for fields #7130

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

Merged
merged 1 commit into from
Apr 10, 2025
Merged

Conversation

bastianallgeier
Copy link
Member

@bastianallgeier bastianallgeier commented Apr 9, 2025

Changelog

Enhancements

  • New ::submit for fields to be used when a form is submitted in a request. ::fill() is now only responsible for providing the values that the form should have on render.

Breaking changes

None

Docs

Full docs for all Form changes: https://www.notion.so/getkirby/Fields-docs-1c359ef0a5cb805189b5ffdc7fa54e0b

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add changes & docs to release notes draft in Notion

@bastianallgeier bastianallgeier added this to the 5.0.0-rc.1 milestone Apr 9, 2025
@bastianallgeier bastianallgeier requested a review from a team April 9, 2025 11:31
@bastianallgeier bastianallgeier mentioned this pull request Apr 9, 2025
26 tasks
*/
public function submit(mixed $value): static
{
return $this->fill($value);
Copy link
Member

@distantnative distantnative Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understanding: E.g. with the picker fields, this would be the place where we could transform the big data array to simple list of (UU)IDs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly. We basically have two ways now:

::fill:
values come from storage, will be used for field components and might need to be transformed

::submit
values come from form submissions and will eventually go into storage and they might need to be transformed.

@bastianallgeier bastianallgeier merged commit bb4281f into v5/develop Apr 10, 2025
12 checks passed
@bastianallgeier bastianallgeier deleted the v5/enhancement/submit branch April 10, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants