Skip to content

Require Actual Attendees before closing an event - #29

Open
dd32 wants to merge 2 commits into
productionfrom
fix/claude/1603-require-actual-attendees-v2
Open

Require Actual Attendees before closing an event#29
dd32 wants to merge 2 commits into
productionfrom
fix/claude/1603-require-actual-attendees-v2

Conversation

@dd32

@dd32 dd32 commented Mar 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Shows the Actual Attendees field when event status is wcpt-scheduled (previously only shown after wcpt-closed), so supporters can fill it in before closing
  • Adds validation to prevent manual transition to wcpt-closed without filling in the Actual Attendees count
  • Cron auto-close (close_wordcamps_after_event) is not affected - it bypasses this validation since it is not an admin form submission and auto-fills the field from CampTix data
  • Adds admin error notice when the validation blocks closing

Changes

  • wordcamp-admin.php: Changed Actual Attendees visibility condition from wcpt-closed only to wcpt-scheduled or wcpt-closed. Added closed-status validation in require_complete_meta_to_publish_wordcamp(). Added admin notice Require Actual Attendees before closing an event #5.
  • New test file test-wordcamp-actual-attendees.php with 5 tests covering: validation blocks close without attendees, allows close with attendees, does not block cron, field visibility at scheduled/pre-scheduled statuses.

Test plan

  • Set event to wcpt-scheduled status - verify Actual Attendees field appears
  • Try to close event without filling Actual Attendees - verify error notice and status reverts to scheduled
  • Fill in Actual Attendees and close - verify it works
  • Verify cron auto-close still works (no $_POST context)
  • All 5 new PHPUnit tests pass

Closes WordPress#1603

Generated with Claude Code

dd32 and others added 2 commits March 12, 2026 20:44
- Show the Actual Attendees field when status is wcpt-scheduled (not just
  wcpt-closed) so supporters can fill it before closing
- Prevent manual transition to wcpt-closed without Actual Attendees filled in
- Allow cron auto-close to still work (it auto-fills from CampTix data)
- Add admin notice when the validation blocks closing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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