Patrol overhaul phase 1: Remove rcid parameters
authorMarius Hoch <hoo@online.de>
Sat, 29 Dec 2012 02:53:18 +0000 (03:53 +0100)
committerTim Starling <tstarling@wikimedia.org>
Sat, 25 May 2013 10:04:01 +0000 (12:04 +0200)
commitc451b320e3a99546fe7c46dd517030f53d7ad8bd
tree5bedcbbbe6699193f0d7462b583e4fb27c31403d
parentb65669ff7adbbde55872a8ddd93214a9e1df75c6
Patrol overhaul phase 1: Remove rcid parameters

I've changed the logic in Article::showPatrolFooter to be able
to fetch the recent changes id and to only show the patrol link
in case the change hasn't yet been patrolled.

In case recentchanges patrolling is enabled this will try to
create a patrol link for the revision the user is currently
viewing. If only new page patrolling is enabled it tries to
create a patrol link for the first revision of the page.

Furthermore I've removed the passing around of &rcid parameters
within MediaWiki as those had several issues (some even security
related) and were only a workaround to protect the DB from some
queries, which is no longer needed.

This has already been partly implemented in a different manner in
r45778 but had to be reverted in r46542 due to performance issues.
This version shouldn't cause such issues as I'm only adding one or
two indexed database queries per page view.

I've written this new version of the patch with mostly
performance in mind and even tested the database queries it uses
against the replicated databases of enwiki on the toolserver. I'm
pretty sure this can't be implemented any faster without creating
a new index on the recentchanges table.

As I was on it I've implemented RecentChange::isInRCLifespan which
checks whether the given timestamp is new enough to may have a RC
row. That way we can avoid some DB queries for timestamps which are
older than the max RC age.

Fixes bugs:
(bug 15936) New page's patrol button should always be visible
(bug 35810) ! N pages non-patrol-able
(bug 36641) Patrol page link shows on non-existent revs

Change-Id: I1e24733cafbfdc51b7a5a9a1c1baf948e760fe1a
includes/Article.php
includes/ChangesList.php
includes/RecentChange.php
includes/diff/DifferenceEngine.php
includes/specials/SpecialNewpages.php