Index: trunk/extensions/FlaggedRevs/presentation/FlaggablePageView.php |
— | — | @@ -1785,7 +1785,7 @@ |
1786 | 1786 | return true; // edit will be autoreviewed |
1787 | 1787 | } |
1788 | 1788 | if ( !isset( $editPage->fr_baseFRev ) ) { |
1789 | | - $baseRevId = self::getBaseRevId( $editPage ); |
| 1789 | + $baseRevId = self::getBaseRevId( $editPage, $this->getRequest() ); |
1790 | 1790 | $editPage->fr_baseFRev = FlaggedRevision::newFromTitle( $title, $baseRevId ); |
1791 | 1791 | } |
1792 | 1792 | if ( $editPage->fr_baseFRev ) { |
— | — | @@ -1808,7 +1808,7 @@ |
1809 | 1809 | } elseif ( $this->editWillBeAutoreviewed( $editPage ) ) { |
1810 | 1810 | return true; // edit will be auto-reviewed |
1811 | 1811 | } |
1812 | | - if ( self::getBaseRevId( $editPage ) == $this->article->getLatest() ) { |
| 1812 | + if ( self::getBaseRevId( $editPage, $request ) == $this->article->getLatest() ) { |
1813 | 1813 | # For pages with either no stable version, or an outdated one, let |
1814 | 1814 | # the user decide if he/she wants it reviewed on the spot. One might |
1815 | 1815 | # do this if he/she just saw the diff-to-stable and *then* decided to edit. |
— | — | @@ -1849,13 +1849,11 @@ |
1850 | 1850 | * Note: baseRevId trusted for Reviewers - text checked for others. |
1851 | 1851 | */ |
1852 | 1852 | public function addRevisionIDField( EditPage $editPage, OutputPage $out ) { |
1853 | | - $this->load(); |
1854 | | - $revId = self::getBaseRevId( $editPage ); |
| 1853 | + $revId = self::getBaseRevId( $editPage, $this->getRequest() ); |
1855 | 1854 | $out->addHTML( "\n" . Html::hidden( 'baseRevId', $revId ) ); |
1856 | 1855 | $out->addHTML( "\n" . Html::hidden( 'undidRev', |
1857 | 1856 | empty( $editPage->undidRev ) ? 0 : $editPage->undidRev ) |
1858 | 1857 | ); |
1859 | | - return true; |
1860 | 1858 | } |
1861 | 1859 | |
1862 | 1860 | /** |
— | — | @@ -1863,8 +1861,7 @@ |
1864 | 1862 | * Note: baseRevId trusted for Reviewers - check text for others. |
1865 | 1863 | * @return int |
1866 | 1864 | */ |
1867 | | - protected static function getBaseRevId( EditPage $editPage ) { |
1868 | | - $request = FlaggablePageView::singleton()->getRequest(); |
| 1865 | + protected static function getBaseRevId( EditPage $editPage, WebRequest $request ) { |
1869 | 1866 | if ( !isset( $editPage->fr_baseRevId ) ) { |
1870 | 1867 | $article = $editPage->getArticle(); // convenience |
1871 | 1868 | $latestId = $article->getLatest(); // current rev |