Skip to content

Groups: my-events block now includes events the user organizes - #1826

Open
bor0 wants to merge 5 commits into
productionfrom
fix/1810-my-events-organized-events
Open

Groups: my-events block now includes events the user organizes#1826
bor0 wants to merge 5 commits into
productionfrom
fix/1810-my-events-organized-events

Conversation

@bor0

@bor0 bor0 commented Jul 29, 2026

Copy link
Copy Markdown
Member
Screenshot 2026-07-29 at 11 31 58

Summary

The wporg/my-events block ("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":

  • events the user RSVPed "attending" to (previous behavior)
  • events the user authored (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):

  • Organizer with no RSVPs: As a user who authored a published, upcoming gatherpress_event but has no gatherpress_rsvp comments, visit the group's front page. The "My upcoming events" block should list that event.
  • Organizer who also RSVPed: As a user who both authored some events and RSVPed "attending" to others (including overlap where they RSVPed to their own event), confirm the block shows the full union with no duplicate entries for events that are both authored and RSVPed to.
  • Past events excluded: Confirm events whose datetime_end_gmt has already passed do not appear, whether from authorship or RSVP.
  • No organized or RSVPed events: As a plain member with neither RSVPs nor authored events, confirm the block renders nothing (no heading, no empty state, matches prior behavior).
  • Ordering: Confirm listed events are in chronological order by start date.
  • Run npm run build in wporg-groups-frontend/ if testing the compiled block output (the build/ directory is gitignored and regenerated at deploy).

🤖 Generated with Claude Code

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>
@bor0
bor0 requested a review from raicem July 29, 2026 09:51
bor0 and others added 2 commits July 30, 2026 11:00
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/e2e/event-organiser.spec.js Outdated
bor0 and others added 2 commits July 30, 2026 13:11
- 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>
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.

Groups: my-events block shows nothing for users who created events but haven't RSVP'd

2 participants