What is the problem?
In the "Categories filter" UI, after removing a category, without saving, if you add the same category again and attempt to save you see an error such as:
500: Internal Server Error The server said: An exception occurred while executing 'INSERT INTO event_category (ec_title, ec_category_id, ec_domain, ec_event_id) VALUES (?, ?, ?, ?)' with params ["Chicagoland", 61612, "en.wikivoyage", 374]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '374-61612-en.wikivoyage' for key 'ec_event_domains'
Presumably it attempts to update the event with what it thinks is a new category and hits the integrity constraint.
Might happen to a user if they, for example, accidentally remove a category and, rather than refreshing the page, re-enter it.
Steps to reproduce problem
- In the Categories filter UI, enter any category in any wiki and click Save
- Remove the category you just saved, then re-enter it and click save
Expected behavior: Event should return to the same state as it was after step 1
Observed behavior: Fatal error