Groups: my-events block now includes events the user organizes - #1826
Open
bor0 wants to merge 5 commits into
Open
Groups: my-events block now includes events the user organizes#1826bor0 wants to merge 5 commits into
bor0 wants to merge 5 commits into
Conversation
The block previously only surfaced events the user had RSVPed "attending" to, so an organizer who created an event but never RSVPed to their own event saw an empty "My upcoming events" block. Union authored (post_author) events with attending RSVPs, deduplicated, and order the result chronologically. Fixes #1810 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The my-events block now lists events the organiser created, so the event title appears twice on the front page (main link + my-events entry), tripping Playwright's strict getByText(). Scope the assertion to the main event link instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the wporg/my-events (“My upcoming events”) block so it includes both events the current user RSVPed “attending” to and events they authored/organize, dedupes them, and orders the results chronologically by event start time.
Changes:
- Union RSVP-attending event IDs with authored event IDs, then filter to upcoming and sort by
datetime_start_gmt ASC. - Update the E2E organiser flow to account for the event title appearing in more than one place on the front page.
- Expand the block docblock to document the intended “RSVP + organized events” behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/e2e/event-organiser.spec.js | Adjusts the front-page assertion to avoid strict-mode ambiguity now that the event title can appear multiple times. |
| public_html/wp-content/mu-plugins/wporg-groups-frontend/src/blocks/my-events/render.php | Expands the block’s “my events” source set to include authored events and changes ordering to chronological upcoming order. |
- my-events/render.php: drop the 100-post cap on an organizer's own events. The default orderby is post_date (creation date) descending, so the cap could silently drop an upcoming event created earlier than the organizer's 100 most recently created events, for long-time organizers with more than 100 published events. - event-organiser.spec.js: scope the front-page title assertion to the "Upcoming events" card grid (#upcoming) instead of relying on the my-events block's accessible name happening to differ (it includes a date prefix). The my-events block renders as a sibling outside #upcoming in front-page.html, so this stays correct regardless of what else on the page ends up sharing the title text (e.g. a featured-image link). Co-Authored-By: Claude Sonnet 5 <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.
Summary
The
wporg/my-eventsblock ("My upcoming events") only surfaced events the current user had RSVPed "attending" to. Creating or organizing an event does not itself create an RSVP, so an organizer who created an upcoming event but never clicked "RSVP" on their own event saw an empty block, even though the block's title implies it should show events they're running.Confirmed live before fixing: logged in as a user who authored an upcoming published event with zero RSVP comments, and the block rendered nothing at all on the group front page.
Change
In
wporg-groups-frontend/src/blocks/my-events/render.php, the query now unions two sources of "my events":post_author)...deduplicated, then filtered to upcoming and ordered chronologically (
ORDER BY datetime_start_gmt ASC) instead of the previous RSVP-comment insertion order.Fixes #1810
Test plan
Using the local test env (
docker compose), on a group site (e.g.sunshine-coast-qld):gatherpress_eventbut has nogatherpress_rsvpcomments, visit the group's front page. The "My upcoming events" block should list that event.datetime_end_gmthas already passed do not appear, whether from authorship or RSVP.npm run buildinwporg-groups-frontend/if testing the compiled block output (thebuild/directory is gitignored and regenerated at deploy).🤖 Generated with Claude Code