r52882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52881‎ | r52882 | r52883 >
Date:01:02, 8 July 2009
Author:aaron
Status:resolved
Tags:
Comment:
Short-circuited template stuff for API unapprove
Modified paths:
  • /trunk/extensions/FlaggedRevs/api/ApiReview.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/api/ApiReview.php
@@ -82,24 +82,26 @@
8383 if( !$title->quickUserCan('edit') || !RevisionReview::userCanSetFlags($form->dims,$form->oflags,$form->config) )
8484 $this->dieUsage( "You don't have the necessary rights to set the specified flags.", 'permissiondenied' );
8585
86 - // Now get the template and image parameters needed
87 - // If it is the current revision, try the parser cache first
88 - $article = new Article( $title, $revid );
89 - if( $rev->isCurrent() ) {
90 - $parserCache = ParserCache::singleton();
91 - $parserOutput = $parserCache->get( $article, $wgUser );
 86+ if( $form->approve ) {
 87+ // Now get the template and image parameters needed
 88+ // If it is the current revision, try the parser cache first
 89+ $article = new Article( $title, $revid );
 90+ if( $rev->isCurrent() ) {
 91+ $parserCache = ParserCache::singleton();
 92+ $parserOutput = $parserCache->get( $article, $wgUser );
 93+ }
 94+ if( empty( $parserOutput ) ) {
 95+ // Miss, we have to reparse the page
 96+ global $wgParser;
 97+ $text = $article->getContent();
 98+ $options = FlaggedRevs::makeParserOptions();
 99+ $parserOutput = $wgParser->parse( $text, $title, $options );
 100+ }
 101+ // Set version parameters for review submission
 102+ list( $form->templateParams, $form->imageParams, $form->fileVersion ) =
 103+ FlaggedRevs::getIncludeParams( $article, $parserOutput->mTemplateIds, $parserOutput->fr_ImageSHA1Keys );
92104 }
93 - if( empty( $parserOutput ) ) {
94 - // Miss, we have to reparse the page
95 - global $wgParser;
96 - $text = $article->getContent();
97 - $options = FlaggedRevs::makeParserOptions();
98 - $parserOutput = $wgParser->parse( $text, $title, $options );
99 - }
100 -
101 - list( $form->templateParams, $form->imageParams, $form->fileVersion ) =
102 - FlaggedRevs::getIncludeParams( $article, $parserOutput->mTemplateIds, $parserOutput->fr_ImageSHA1Keys );
103 -
 105+
104106 // Do the actual review
105107 list( $approved, $status ) = $form->submit();
106108 if( $status === true ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r56576bug 20705: fixed api review; regression from r52882aaron01:47, 18 September 2009

Status & tagging log