From: jenkins-bot Date: Wed, 17 Feb 2016 16:31:47 +0000 (+0000) Subject: Merge "Don't show patrol links if RCP/NPP are disabled, but file patrol isn't" X-Git-Tag: 1.31.0-rc.0~7931 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=8b38f3887ff8bede5f7f1b8e45b0ca477878cbaf;hp=-c;p=lhc%2Fweb%2Fwiklou.git Merge "Don't show patrol links if RCP/NPP are disabled, but file patrol isn't" --- 8b38f3887ff8bede5f7f1b8e45b0ca477878cbaf diff --combined includes/page/Article.php index d6e73818d8,6ce8cc17cd..caff619997 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@@ -1065,10 -1065,12 +1065,12 @@@ class Article implements Page $outputPage = $this->getContext()->getOutput(); $user = $this->getContext()->getUser(); + $title = $this->getTitle(); $rc = false; - if ( !$this->getTitle()->quickUserCan( 'patrol', $user ) - || !( $wgUseRCPatrol || $wgUseNPPatrol || $wgUseFilePatrol ) + if ( !$title->quickUserCan( 'patrol', $user ) + || !( $wgUseRCPatrol || $wgUseNPPatrol + || ( $wgUseFilePatrol && $title->inNamespace( NS_FILE ) ) ) ) { // Patrolling is disabled or the user isn't allowed to return false; @@@ -1083,7 -1085,7 +1085,7 @@@ } // Check for cached results - $key = wfMemcKey( 'unpatrollable-page', $this->getTitle()->getArticleID() ); + $key = wfMemcKey( 'unpatrollable-page', $title->getArticleID() ); $cache = ObjectCache::getMainWANInstance(); if ( $cache->get( $key ) ) { return false; @@@ -1093,7 -1095,7 +1095,7 @@@ $oldestRevisionTimestamp = $dbr->selectField( 'revision', 'MIN( rev_timestamp )', - [ 'rev_page' => $this->getTitle()->getArticleID() ], + [ 'rev_page' => $title->getArticleID() ], __METHOD__ ); @@@ -1112,8 -1114,8 +1114,8 @@@ [ 'rc_new' => 1, 'rc_timestamp' => $oldestRevisionTimestamp, - 'rc_namespace' => $this->getTitle()->getNamespace(), - 'rc_cur_id' => $this->getTitle()->getArticleID() + 'rc_namespace' => $title->getNamespace(), + 'rc_cur_id' => $title->getArticleID() ], __METHOD__ ); @@@ -1129,12 -1131,12 +1131,12 @@@ // (with rc_type = RC_LOG, rc_log_type = upload). $recentFileUpload = false; if ( ( !$rc || $rc->getAttribute( 'rc_patrolled' ) ) && $wgUseFilePatrol - && $this->getTitle()->getNamespace() === NS_FILE ) { + && $title->getNamespace() === NS_FILE ) { // Retrieve timestamp of most recent upload $newestUploadTimestamp = $dbr->selectField( 'image', 'MAX( img_timestamp )', - [ 'img_name' => $this->getTitle()->getDBkey() ], + [ 'img_name' => $title->getDBkey() ], __METHOD__ ); if ( $newestUploadTimestamp @@@ -1148,7 -1150,7 +1150,7 @@@ 'rc_log_type' => 'upload', 'rc_timestamp' => $newestUploadTimestamp, 'rc_namespace' => NS_FILE, - 'rc_cur_id' => $this->getTitle()->getArticleID() + 'rc_cur_id' => $title->getArticleID() ], __METHOD__, [ 'USE INDEX' => 'rc_timestamp' ] @@@ -1203,7 -1205,7 +1205,7 @@@ } $link = Linker::linkKnown( - $this->getTitle(), + $title, $markPatrolledMsg->escaped(), [], [ @@@ -2653,6 -2655,7 +2655,6 @@@ ); } - /** * @param array $limit * @param array $expiry