Show rollback link on changes list only for RC_EDIT
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 30 May 2013 05:25:07 +0000 (07:25 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 7 Jun 2013 18:06:32 +0000 (18:06 +0000)
Changing from !RC_NEW to RC_EDIT to have no rollback links, when this
method is called accidently for RC_LOG or RC_EXTERNAL (or for the old
RC_MOVE/RC_MOVE_OVER_REDIRECT). For that types there are 0 revisions to
rollback.

Change-Id: I1cbdc87a8b8e0cecf6fbfa3b3a64d5015057bccf

includes/ChangesList.php

index b1bb82e..e0f522a 100644 (file)
@@ -532,7 +532,7 @@ class ChangesList extends ContextSource {
         * @param $rc RecentChange
         */
        public function insertRollback( &$s, &$rc ) {
-               if ( $rc->mAttribs['rc_type'] != RC_NEW && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) {
+               if ( $rc->mAttribs['rc_type'] == RC_EDIT && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) {
                        $page = $rc->getTitle();
                        /** Check for rollback and edit permissions, disallow special pages, and only
                          * show a link on the top-most revision */