Repository navigation
Groups: store registration questions in GatherPress's form schema meta - #2234
Merged
Merged
Conversation
Questions now live in `gatherpress_rsvp_form_schemas` under a `wporg_groups`
schema, and answers in `gatherpress_custom_{id}` comment meta. A
`gatherpress_rsvp_form_schemas` filter keeps the schema when GatherPress
rebuilds it from blocks on save.
Fixes #1871.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Member
Author
|
Migration ran on production after deploy. Read back afterwards: internal-testing-group has 7 schemas and 33 answered RSVPs, gatherpress has 1 and 16. Questions show in the RSVP dialog on production. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1871.
GatherPress 0.36.0 shipped the fixes this was blocked on, so registration questions now use GatherPress's own storage:
wporg_groupsschema ingatherpress_rsvp_form_schemas(text fields, same shape GatherPress builds from Form Field blocks).gatherpress_custom_{question id}comment meta on the RSVP.gatherpress_rsvp_form_schemasfilter keeps our schema when GatherPress rebuilds it from blocks on save. Block-derived schemas are left alone.Our RSVP route and the guard on
/gatherpress/v1/event/rsvpstay: GatherPress only validates custom fields on its open-RSVP route, which groups switch off. The function API inrsvp-questions.phpis unchanged, so REST, render and JS don't change.Migration
Existing questions and answers have to be moved after deploy. Run this from the sandbox (dry run first). It walks every site, is idempotent, and never overwrites data already under the new keys. I'll post the output here.
migrate-rsvp-questions.php
Testing
phpunit --filter Test_Groups_RSVP_Questions. The new tests cover the schema shape, a block-editor save keeping the schema (alongside a block'sform_0), and per-field answer meta.gatherpress_custom_*,"0"kept, organizer sees them, attendee sees them prefilled.wp/v2: schema survives.🤖 Generated with Claude Code