Page MenuHomePhabricator

API should not be able to associate edits with events that have not started yet
Closed, ResolvedPublic

Description

Followup from T401208

Currently using the API I can associate an edit with an event that has not yet started. It will then display in the UI in the collaborative contributions table. This action is not currently allowed when using the UI, only when associating and event through the API.

Acceptance criteria

  • API should not be able to associate edits with events that have not yet started OR that have ended
    • The following error message will be shown: "This event is not currently active, so you cannot associate this edit with it."

Screen Recording 2025-10-31 at 6.00.37 PM.gif (1×2 px, 1 MB)

Event Timeline

vaughnwalters reopened this task as Open.

I'll begin working on this but I'll need the copy for the error message @ifried @JFernandez-WMF

Also wondering whether this scenario and the one where the event has finished should use the same error message, instead of two separate messages (we currently have "Event has ended and is no longer accepting edit associations" which was never part of any task's AC).

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

[mediawiki/extensions/CampaignEvents@master] [WIP] Prevent associating edits with future events

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

Text to use: "This event is not currently active, so you cannot associate this edit with it."

Change #1202705 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Prevent associating edits with future events

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

✅ API should not be able to associate edits with events that have not yet started OR that have ended
✅ The following error message will be shown: "This event is not currently active, so you cannot associate this edit with it."

has not yet startedevent has ended
Screen Recording 2025-11-14 at 4.39.55 PM.gif (1×3 px, 1 MB)
Screen Recording 2025-11-14 at 4.41.15 PM.gif (1×3 px, 816 KB)

AC met, sending to product sign off