Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -345,6 +345,8 @@ |
346 | 346 | $wgHooks['ArticleSaveComplete'][] = 'FlaggedRevsHooks::autoPromoteUser'; |
347 | 347 | # Adds table link references to include ones from the stable version |
348 | 348 | $wgHooks['LinksUpdate'][] = 'FlaggedRevsHooks::extraLinksUpdate'; |
| 349 | +# Clear dead config rows |
| 350 | +$wgHooks['ArticleDeleteComplete'][] = 'FlaggedRevsHooks::onArticleDelete'; |
349 | 351 | # Check on undelete/merge for changes to stable version |
350 | 352 | $wgHooks['ArticleMergeComplete'][] = 'FlaggedRevsHooks::updateFromMerge'; |
351 | 353 | $wgHooks['ArticleRevisionUndeleted'][] = 'FlaggedRevsHooks::updateFromRestore'; |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -145,7 +145,16 @@ |
146 | 146 | wfProfileOut( __METHOD__ ); |
147 | 147 | return true; |
148 | 148 | } |
| 149 | + |
| 150 | + public static function onArticleDelete( &$article, &$user, $reason, $id ) { |
| 151 | + $dbw = wfGetDB( DB_MASTER ); |
| 152 | + $dbw->delete( 'flaggedpage_config', |
| 153 | + array( 'fpc_page_id' => $article->getID() ), |
| 154 | + __METHOD__ ); |
149 | 155 | |
| 156 | + return true; |
| 157 | + } |
| 158 | + |
150 | 159 | /** |
151 | 160 | * Inject stable links on LinksUpdate |
152 | 161 | */ |