Index: trunk/extensions/FlaggedRevs/api/ApiReview.php |
— | — | @@ -82,24 +82,26 @@ |
83 | 83 | if( !$title->quickUserCan('edit') || !RevisionReview::userCanSetFlags($form->dims,$form->oflags,$form->config) ) |
84 | 84 | $this->dieUsage( "You don't have the necessary rights to set the specified flags.", 'permissiondenied' ); |
85 | 85 | |
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 ); |
92 | 104 | } |
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 | + |
104 | 106 | // Do the actual review |
105 | 107 | list( $approved, $status ) = $form->submit(); |
106 | 108 | if( $status === true ) { |