Page MenuHomePhabricator

Prevent Special:NewItem from creating items multiple times (double-submitting)
Closed, ResolvedPublic


When creating Items and Properties on Special:NewItem and Special:NewProperty respectively, it's possible to submit the form twice.

Submitting the form twice will lead to two entities being created or the entity being created, but the user still gets an error message (because it can't be created twice).

In order to fix this, the form on the above mentioned special pages should be disabled using JavaScript when initially submitted, so that it can only ever be submitted once.

Event Timeline

Just came across an older example from January 2016: shows two sequential item creations, both had the same ruwiki sitelink (Q22244973 has since been merged into Q1560118, but there are still two items with the same sitelink).

hoo added subscribers: Lydia_Pintscher, hoo.

Probably a duplicate of T44325: Prevent creation of items having the same sitelinks (duplicates).

If you submit the form twice, you will get two Items… the data for the constraint checks is being put in place asynchronously some time after the Item has been created, this (most likely) wont happen by the time the second post request is being handled.

We could potentially add a JavaScript hack that makes sure that the form is not double posted?

Thanks for that link. I'm not having much luck finding existing tickets lately. :/

I'm not aware of submitting the form twice, but I suppose it could have happened accidentally. Adding something to Special:NewItem to stop the form from being submitted twice in a very short period of time sounds like it could be a fairly easy way of stopping some of the duplicates.

hoo renamed this task from Special:NewItem created multiple items with the same sitelink to Prevent Special:NewItem from creating items multiple times (double-submitting).Oct 29 2016, 6:05 AM
hoo updated the task description. (Show Details)
hoo added a project: Ladies-That-FOSS-Wikidata.

Change 318681 had a related patch set uploaded (by Juliahimmel):
disallow double submit of newEntity form

Change 318681 merged by jenkins-bot:
Disallow double submit of newEntity form