Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -384,7 +384,7 @@ |
385 | 385 | # Clear dead config rows |
386 | 386 | $wgHooks['ArticleDeleteComplete'][] = 'FlaggedRevsHooks::onArticleDelete'; |
387 | 387 | $wgHooks['ArticleRevisionVisiblitySet'][] = 'FlaggedRevsHooks::onRevisionDelete'; |
388 | | -$wgHooks['TitleMoveComplete'][] = 'FlaggedRevsHooks::updatePendingPostMove'; |
| 388 | +$wgHooks['TitleMoveComplete'][] = 'FlaggedRevsHooks::onTitleMoveComplete'; |
389 | 389 | # Check on undelete/merge for changes to stable version |
390 | 390 | $wgHooks['ArticleMergeComplete'][] = 'FlaggedRevsHooks::updateFromMerge'; |
391 | 391 | $wgHooks['ArticleRevisionUndeleted'][] = 'FlaggedRevsHooks::updateFromRestore'; |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -164,12 +164,29 @@ |
165 | 165 | return true; |
166 | 166 | } |
167 | 167 | |
168 | | - public static function updatePendingPostMove( &$otitle, &$ntitle, $user, $pageId ) { |
| 168 | + /** |
| 169 | + * Update pending revision table |
| 170 | + * Autoreview pages moved into content NS |
| 171 | + */ |
| 172 | + public static function onTitleMoveComplete( &$otitle, &$ntitle, $user, $pageId ) { |
| 173 | + global $wgFlaggedRevsAutoReviewNew; |
169 | 174 | $fa = FlaggedArticle::getTitleInstance( $ntitle ); |
170 | | - // re-validate NS/config (new title may not be reviewable) |
171 | | - if( !$fa->isReviewable() || !$fa->getStableRev(FR_MASTER) ) { |
172 | | - self::clearDeadLinks( $pageId ); |
| 175 | + // Re-validate NS/config (new title may not be reviewable) |
| 176 | + if( $fa->isReviewable() ) { |
| 177 | + // Moved from non-reviewable to reviewable NS? |
| 178 | + if( $wgFlaggedRevsAutoReviewNew && $user->isAllowed('autoreview') |
| 179 | + && !FlaggedRevs::isPageReviewable( $otitle ) ) |
| 180 | + { |
| 181 | + $article = new Article( $ntitle ); |
| 182 | + $rev = Revision::newFromTitle( $ntitle ); |
| 183 | + // Treat this kind of like a new page... |
| 184 | + FlaggedRevs::autoReviewEdit( $article, $user, $rev->getText(), $rev ); |
| 185 | + return true; // pending list handled |
| 186 | + } else if( $fa->getStableRev(FR_MASTER) ) { |
| 187 | + return true; // nothing to do |
| 188 | + } |
173 | 189 | } |
| 190 | + self::clearDeadLinks( $pageId ); |
174 | 191 | return true; |
175 | 192 | } |
176 | 193 | |