Skip to content

Let plugins define custom regform field types#5282

Merged
ThiefMaster merged 2 commits intoindico:masterfrom
ThiefMaster:regform-fields-plugin
Mar 10, 2022
Merged

Let plugins define custom regform field types#5282
ThiefMaster merged 2 commits intoindico:masterfrom
ThiefMaster:regform-fields-plugin

Conversation

@ThiefMaster
Copy link
Copy Markdown
Member

@ThiefMaster ThiefMaster commented Mar 10, 2022

Considering that this will most likely be a niche feature, I didn't spend a lot of time gracefully failing cases where a registration form contains a field but doesn't have the corresponding plugin; accessing such a form will simply fail with an error.

There's no special handling for fields containing files right now, I hope that someone who adds e.g. a passport photo field will eventually see how well this is possible and if there's a need for additional signals or calling methods of the field class instead of hardcoded logic... Nevermind, found an easy solution to cover this.

In case someone who sees this PR wants to see how a custom field would be defined, here's the diff of what I used to test (yes, I was lazy and just added it to the one plugin that already uses regform-related extension points ;)): pluginfield.diff.txt

@ThiefMaster ThiefMaster added this to the v3.2 milestone Mar 10, 2022
@ThiefMaster ThiefMaster merged commit 52a12bb into indico:master Mar 10, 2022
@ThiefMaster ThiefMaster deleted the regform-fields-plugin branch March 10, 2022 16:34
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.

1 participant