Repository navigation
CampTix: hide unknown attendees from the public attendees list - #2117
Merged
mcliwanow merged 2 commits intoSep 24, 2026
Merged
Conversation
`hide_unconfirmed_attendees()` only excluded attendees whose username is the `[[ unconfirmed ]]` placeholder. The buyer's own row keeps the buyer's real username even when it was marked as an unknown attendee, so it slipped through and showed up on `[camptix_attendees]` as "Unknown Attendee". Also exclude the unknown-attendee placeholder email, which is how `prevent_unknown_attendees_viewing_private_content()` already identifies these records. Bump the attendees cache buster so sites stop serving the cached list with those rows as soon as this is deployed. Adds the first tests for the Require Login addon, which is now enabled in the CampTix test bootstrap the same way `camptix-tweaks` enables it on every WordCamp site. Fixes WordPress#2114.
With the Require Login addon now loaded in the test bootstrap, its camptix_checkout_update_post_meta callback reads $attendee->username. Real checkout attendees always have it, because the addon sets it on camptix_form_register_complete_attendee_object, but the attendees this test builds by hand didn't, which wrote an undefined-property warning to the error log.
36 of 38 tasks
mcliwanow
self-requested a review
September 24, 2026 09:42
mcliwanow
approved these changes
Sep 24, 2026
mcliwanow
left a comment
Contributor
There was a problem hiding this comment.
Reproduced it locally with a buyer row marked unknown: it shows on production and it's gone on this branch, and the cache key bump means no flush is needed. Removing the new tix_email clause fails only the new test. Approving.
I will deploy this change soon.
bor0
added a commit
that referenced
this pull request
Oct 8, 2026
* CampTix: store an unknown attendee on the buyer's row as unknown Follow-up to #2117. On a direct link to the ticket form, the "I don't know who will use this ticket yet" checkbox also shows on the buyer's own row. Ticking it there stored a half-unknown ticket: the stub name (only filled in when the name was empty), the buyer's real pre-filled email, and the buyer's username. Neither check on the public list catches that, so the ticket was listed as "Unknown Attendee". - add_unknown_attendee_info_stubs() always uses the stub name and the placeholder email when the box is ticked. The form only hides the fields, so it still submits whatever was pre-filled. - Row 1 gets the [[ unconfirmed ]] username when the box is ticked, so the ticket can be claimed like any other unknown ticket. The buyer's username is kept in tix_buyer_username, and get_abandoned_draft_attendee_ids() checks it too, so the buyer isn't held up by their own abandoned drafts. - A new camptix_checkout_receipt_email filter lets Require Login send the receipt to the logged-in buyer when it would go to the placeholder. See #2114 * CampTix: send the claim link on a one-ticket order for an unknown attendee Multiple purchases send each unknown attendee's ticket e-mail to the buyer, with the claim link to forward. A one-ticket order only got the receipt, which links to the buyer's own order page, so the buyer had no claim link to pass on. Adds a camptix_email_single_purchase_attendee_ticket filter after the single-purchase receipt, and Require Login uses it to send the existing unknown-attendee e-mail when the order's only ticket is unknown. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Boro Sitnikovski <buritomath@gmail.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What
hide_unconfirmed_attendees()keeps unclaimed tickets off the public[camptix_attendees]list, but it only excludes attendees whose username is the[[ unconfirmed ]]placeholder. The buyer's own row keeps the buyer's real username even when it was marked as an unknown attendee (add_username_to_attendee_object()), so it gets past the filter and shows up as Unknown Attendee.This PR also excludes the unknown-attendee placeholder email (
UNKNOWN_ATTENDEE_EMAIL), the same wayprevent_unknown_attendees_viewing_private_content()already identifies these records. It's a query change, so it hides the rows that are already on live sites too, and no data migration is needed.It also bumps the
[camptix_attendees]cache buster. The cache key only hashes the shortcode attributes, so without the bump sites would keep serving the cached list with these rows for up to 3 hours (1 day on archived sites) after deploy.Fixes #2114. See #1480, #1721.
This PR doesn't change checkout. Making an unknown buyer row get the placeholder username (option 2 in #2114) would only affect new purchases, and it narrows what #1480 widened, so I've left it for a separate follow-up.
Tests
These are the first tests for the Require Login addon.
tests/addons/test-require-login.phprenders the real shortcode against real attendee posts:[[ unconfirmed ]]username is hidden (existing behaviour, now covered);To make that possible, the CampTix test bootstrap now enables the addon through
camptix_default_addons, the same waycamptix-tweaksdoes on every WordCamp site. Addons have to be registered beforecamptix_init, so a test can't load it itself. One existing test,test_insert_attendee_drafts_aborts_and_cleans_up_when_a_draft_cannot_be_written, builds checkout attendees by hand, so it now setsusernameon them, as the addon does during a real checkout. Without that, the addon'scamptix_checkout_update_post_metacallback wrote an undefined-property warning to the error log.Checked locally:
hide_unconfirmed_attendeeshook removed, both "hidden" tests fail.productionin the local harness: 1797 vs. 1794 tests (+3 tests, +5 assertions), and the set of failing tests is identical in both runs. Those failures already exist in the local environment, and none are in CampTix. The PHP warnings also match cleanproductiononce the fixture above is fixed.intl)..github/bin/phpcs-branch.phpagainstproduction: clean.How to test the changes in this Pull Request:
tix_attendeepost withtix_first_name=Unknown,tix_last_name=Attendee,tix_email=unknown.attendee@example.organdtix_username= any real username. That's what checkout stores when the buyer's own row is marked as unknown (see CampTix: "Unknown Attendee" tickets show up on the public attendees page #2114 for how that happens).[camptix_attendees](e.g./attendees/).phpunit --filter Test_Camptix_Require_Login_Addon.