RevertAction: Prevent file revert if current version is identical
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 1 Sep 2016 21:49:19 +0000 (23:49 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 2 Sep 2016 11:21:55 +0000 (11:21 +0000)
commitf911bbdb7c015e4c1a3d7b5da0fa28e0f98f364b
tree12646b5c8debc51ad8b7d62f82bd47ae5642bf26
parent678643d1030ed3c3a539415384304de10a64b796
RevertAction: Prevent file revert if current version is identical

There are several reasons for this:

* The file thumbnail shown on the main file page is cached by the
  browser, as images tend to be. This often confuses users into
  thinking their revert did not work, and into attempting it again.
  Recent examples:
  * https://commons.wikimedia.org/wiki/Commons:Village_pump/Archive/2016/07#Wrong_SVG_rendering_on_File:DuckDuckGo_logo_and_wordmark.svg
  * https://commons.wikimedia.org/w/index.php?title=Commons:Upload_help&oldid=205348523#Reversion_is_not_working_for_me.
  Ideally we'd prevent the caching, but preventing repeated reverts
  should also work.

* Refreshing the success page causes the revert to be attempted again
  (T53383). The usual solution to this is the Post/Redirect/Get
  pattern, but we want to show a success message so that would require
  some more changes (something similar to the post-edit notification).

* It can serve as a "revert conflict" detection mechanism, crude but
  better than none.

In the unlikely case that uploading an identical older version of
the file is necessary, it can still be done using Special:Upload.

Bug: T53383
Change-Id: I37e04a536c5c2fc6cdbe59f6f598bb0c7f25d7a7
includes/actions/RevertAction.php
languages/i18n/en.json
languages/i18n/qqq.json