Page MenuHomePhabricator

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

Description

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

Nikki created this task.Oct 2 2016, 12:51 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 2 2016, 12:51 PM
Nikki added a comment.Oct 7 2016, 7:59 AM

It happened again with https://www.wikidata.org/wiki/Q27131200 and https://www.wikidata.org/wiki/Q27131201. I clicked the submit button this time.

Nikki added a comment.Oct 13 2016, 9:34 AM

Just came across an older example from January 2016:
https://www.wikidata.org/wiki/Special:Contributions/77.35.1.85 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?

Nikki added a comment.Oct 13 2016, 3:10 PM

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

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

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

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

juliahimmel closed this task as Resolved.Oct 29 2016, 2:58 PM
juliahimmel removed a project: Patch-For-Review.