Page MenuHomePhabricator

Allow creation and editing of events outside of event namespace in wiki interface
Closed, ResolvedPublic3 Estimated Story Points

Description

Acceptance criteria

Given that I am allowed to organize events:

When I create an event using Special:EnableEventRegistration
AND there is a single permitted namespace for event registration
Then the event page field will autocomplete page titles for that namespace only.

When I create an event using Special:EnableEventRegistration
AND there are more than one permitted namespace for event registration
Then the event page field will autocomplete page titles for all namespaces, not just the allowed ones (this limitation is addressed in T389078).

When I create an event using Special:EnableEventRegistration
AND the selected namespace is in the list configured in community configuration (T387966)
Then the event will be created successfully.

When I create an event using Special:EnableEventRegistration
AND the selected namespace is NOT in the list configured in community configuration (T387966)
Then the event will be NOT be created successfully
AND an error will be shown with the text below.

When I edit an event using Special:EditEventRegistration
AND the event page namespace is NOT in the list of allowed namespaces
AND I do NOT modify the event page
Then the event will be edited successfully

When I edit an event using Special:EditEventRegistration
AND the event page namespace is NOT in the list of allowed namespaces
AND I modify the event page
AND the new event page is not in a permitted namespace
Then the event will be NOT be edited successfully
AND an error will be shown with the text below.

Error message:

  • If there is a single permitted namespace: use the standard error, whatever that is (it should mention the name of the allowed namespace, but note that it is buggy for the mainspace: T389083)
  • If there are multiple permitted namespaces: The event page must be in one of the permitted namespaces.

Event Timeline

MHorsey-WMF set the point value for this task to 3.

Change #1128454 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] Validate event page namespace when enabling registration

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

Change #1128539 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] Skip event page namespace validation on edits when page is unchanged

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

Change #1128454 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Validate event page namespace when enabling registration

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

Change #1128539 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Skip event page namespace validation on edits when page is unchanged

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

Community configuration is not yet available, but this can be tested as a normal config setting, with something like $wgCampaignEventsEventNamespaces = [ NS_MAIN, NS_EVENT, NS_PROJECT ];.

vaughnwalters subscribed.

Given that I am allowed to organize events:

When I create an event using Special:EnableEventRegistration
AND there is a single permitted namespace for event registration
✅ Then the event page field will autocomplete page titles for that namespace only.

does not autocomplete for pages outside of namespace
Screenshot 2025-04-01 at 1.48.16 PM.png (306×910 px, 31 KB)

When I create an event using Special:EnableEventRegistration
AND there are more than one permitted namespace for event registration
✅ Then the event page field will autocomplete page titles for all namespaces, not just the allowed ones (this limitation is addressed in T38908).

allowed namespacenot allowed namespace
Screenshot 2025-04-01 at 1.46.48 PM.png (492×1 px, 62 KB)
Screenshot 2025-04-01 at 1.45.04 PM.png (388×1 px, 59 KB)

When I create an event using Special:EnableEventRegistration
AND the selected namespace is in the list configured in community configuration (T387966)
✅ Then the event will be created successfully.
QA note - this is just a local test

Screenshot 2025-04-01 at 2.03.29 PM.png (816×1 px, 149 KB)

When I create an event using Special:EnableEventRegistration
AND the selected namespace is NOT in the list configured in community configuration (T387966)
Then the event will be NOT be created successfully
✅ AND an error will be shown with the text below.

single namespacemultiple namespaces
Screenshot 2025-04-01 at 5.51.04 PM.png (550×1 px, 84 KB)
Screenshot 2025-04-01 at 5.42.35 PM.png (400×1 px, 49 KB)

When I edit an event using Special:EditEventRegistration
AND the event page namespace is NOT in the list of allowed namespaces
AND I do NOT modify the event page
❌ Then the event will be edited successfully

Screen Recording 2025-04-02 at 9.55.55 AM.gif (1×1 px, 3 MB)

@Daimona When I remove a namespace after the namespace has already been created then I can no longer successfully edit the event. See above gif, removing the project namespace.


When I edit an event using Special:EditEventRegistration
AND the event page namespace is NOT in the list of allowed namespaces
AND I modify the event page
AND the new event page is not in a permitted namespace
Then the event will be NOT be edited successfully
✅ AND an error will be shown with the text below.

multiple namespacessingle namespace
Screenshot 2025-04-01 at 11.12.23 PM.png (588×1 px, 74 KB)
Screenshot 2025-04-01 at 11.13.36 PM.png (644×1 px, 86 KB)

Change #1133449 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] Consider current namespace as valid in Special:EditEventRegistration

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

@Daimona When I remove a namespace after the namespace has already been created then I can no longer successfully edit the event. See above gif, removing the project namespace.

Can confirm this, should be a small fix.

Change #1133449 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Consider current namespace as valid in Special:EditEventRegistration

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

@Daimona When I remove a namespace after the namespace has already been created then I can no longer successfully edit the event. See above gif, removing the project namespace.

Can confirm this, should be a small fix.

When I edit an event using Special:EditEventRegistration
AND the event page namespace is NOT in the list of allowed namespaces
AND I do NOT modify the event page
✅ Then the event will be edited successfully

Screen Recording 2025-04-02 at 3.01.49 PM.gif (898×960 px, 2 MB)

This is functioning as expected now. All AC met (also see T387967#10704403). Moving to design sign off.

ifried subscribed.

As this is now testable on the beta cluster and looking good, I am marking this work as done.