Page MenuHomePhabricator

Validate event namespace for retrieval and display
Closed, ResolvedPublic

Description

Acceptance criteria

The code that retrieves the event associated to a page should be updated to check for the configured list of namespaces, instead of just the Event namespace. So, given I have an event in any namespace (allowed or not):

  • I should see the registration header on the event page
  • If I delete the event page, the event is deleted also
  • If I try to create an invitation list for a page outside the event namespace, the page is available in the form

However: when I visit any page without event registration but in a permitted namespace, then I see the header with a call to action to enable registration IF AND ONLY IF the page is in the Event namespace.

Event Timeline

Pay special attention to Special:AllEvents as the pager contains it's own database code.

After discussion with @ifried the edge case where a namespace is removed after events are created will be handled in the following way:

On the local wiki, the events will be treated as if they do not exist.
On collaboration list, because we cannot know the configuration of a local wiki, we will display any events that exist.
If a link is followed from the collaboration list to an event in a disallowed namespace, we will detect this via a referrer or query parameter and display a message.

I will update the AC to reflect this

On the local wiki, the events will be treated as if they do not exist.
On collaboration list, because we cannot know the configuration of a local wiki, we will display any events that exist.
If a link is followed from the collaboration list to an event in a disallowed namespace, we will detect this via a referrer or query parameter and display a message.

What about the other places that can lead you to such an event? Like Special:MyEvents, direct linking, and presumably anything built on top of the API. If we're going to need a message anyway, I wonder if it would be simpler to just display them all the time, instead of just sometimes, for simplicity in both the code and UX. I'm likely missing something though. (Also worth noting, if we always display them, we should let people delete those events via DeleteEventRegistration etc., so they can be manually cleaned up)

Change #1131710 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] Implement correct behaviour for namespace checks

https://gerrit.wikimedia.org/r/1131710

Change #1131710 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Implement correct behaviour for namespace checks

https://gerrit.wikimedia.org/r/1131710

vaughnwalters subscribed.

I should see the registration header on the event page

Screenshot 2025-04-03 at 9.07.28 PM.png (534×1 px, 98 KB)


If I delete the event page, the event is deleted also
Event was successfully deleted when deleting the event page

Screenshot 2025-04-03 at 9.14.20 PM.png (529×891 px, 47 KB)


If I try to create an invitation list for a page outside the event namespace, the page is available in the form

Screen Recording 2025-04-03 at 10.13.26 PM.gif (1×1 px, 287 KB)

I did find a (likely edge case) bug related to this, and filed it at T391065


✅ However: when I visit any page without event registration but in a permitted namespace, then I see the header with a call to action to enable registration IF AND ONLY IF the page is in the Event namespace.


AC met, and after filing that bug ticket, I am sending this to product sign off

This is now testable on the beta cluster & working as expected, so I'm marking it as done.