Repository navigation
Participation Notifier: Campus Connect organizers should be automatically assigned their own badge instead of the WordCamp Organizer badge - #2216
Conversation
…onnect Organizer badge instead of the WordCamp Organizer badge. - When building the association payload for a published `wcb_organizer` post, look up the site’s Central `wordcamp` post and use `event_subtype === campusconnect` to choose `campus-connect-organizer` vs `wordcamp-organizer`. - Track each association with its own usermeta prefix (`wc_wcb_organizer_*` vs `wc_campus_connect_organizer_*`) so add/remove counts stay independent when someone organizes both event types. - Ship a one-time WP-CLI migration (`wp wc-cc-organizer-meta migrate`) to rename any legacy Campus Connect keys that still use the WordCamp prefix. Same disposable pattern as the other `wp-cli-commands` backfills: delete the command file (and its bootstrap require) after it has been run on production (though safe to re-run). - Add a PHPUnit suite for the notifier: permanent association/prefix coverage, plus migration tests that mark incomplete (not fail) if the CLI file has already been removed.
…s, also assign/remove badges as needed. Ensures each Campus Connect organizer has the `campus-connect-organizer` Profiles association, and removes `wordcamp-organizer` when they have no remaining WordCamp organizer usermeta (they were incorrectly given that badge before association selection was subtype-aware).
… avoiding a PHP 8.5 deprecation notice.
|
Thanks for picking this up. I read through the change and have two notes and one question. 1. An event's type changed after organizers were added A wrangler can change the Event Subtype on Central at any time (
Running 2. A branch that can't run in Inside Question: when the badge is given The badge is given when the organizer post is published on the event site, the same as for WordCamps, which is what comment 8 on meta#8318 suggested. Comments 4 and 7 there asked for it once the event tracker is set to Closed. Is publish time the agreed behavior? I'm asking because with it the badge can show on a profile before the event takes place, or for an event that is later cancelled. When the migration runs, I'm happy to check the dry-run list against the Campus Connect events we track for the program, if that helps. |
Summary
Campus Connect organizers currently receive the same
wordcamp-organizerprofiles.w.org badge as WordCamp organizers. Per meta#8318, a new Campus Connect Organizer badge was created to recognize Campus Connect organizers, so they should get thecampus-connect-organizerbadge instead.wcb_organizerpost, look up the site’s Centralwordcamppost and useevent_subtype === campusconnectto choosecampus-connect-organizervswordcamp-organizer.wc_wcb_organizer_*vswc_campus_connect_organizer_*) so add/remove counts stay independent when someone organizes both event types.wp wc-cc-organizer-meta migrate) that:campus-connect-organizerProfiles association.wordcamp-organizerwhen they have no remaining WordCamp organizer usermeta (they were incorrectly given that badge before association selection was subtype-aware).Mixed organizers keep
wordcamp-organizer.--dry-runreports the same usermeta and badge actions without writing or calling Profiles.wp-cli-commandsbackfills: delete the command file (and its bootstrap require) after it has been run on production.How to review this PR
wordcamp-participation-notifier.php— association selection + meta-key prefixes (the lasting change).wp-cli-commands/migrate-campus-connect-organizer-meta.php— one-time usermeta rename + Profiles badge add/remove; safe to re-run /--dry-run.tests/test-campus-connect-organizer-association.phpvstests/test-migrate-campus-connect-organizer-meta.php— permanent vs disposable coverage.Test plan
campus-connect-organizerassociationwordcamp-organizerwp wc-cc-organizer-meta migrate --dry-run, then without--dry-run, on production/stagingManual test steps
campus-connect-organizer(notwordcamp-organizer).wordcamp-organizeris unchanged.wp wc-cc-organizer-meta migrate --dry-run. Confirm it reports:would add campus-connect-organizerfor affected organizerswould remove wordcamp-organizeronly when they have no remaining WordCamp organizer associationswordcamp-organizerbadges are untouched.Fixes #2215.