r41681 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41680‎ | r41681 | r41682 >
Date:01:02, 5 October 2008
Author:aaron
Status:old
Tags:
Comment:
Add minor deletion cleanup function back
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -345,6 +345,8 @@
346346 $wgHooks['ArticleSaveComplete'][] = 'FlaggedRevsHooks::autoPromoteUser';
347347 # Adds table link references to include ones from the stable version
348348 $wgHooks['LinksUpdate'][] = 'FlaggedRevsHooks::extraLinksUpdate';
 349+# Clear dead config rows
 350+$wgHooks['ArticleDeleteComplete'][] = 'FlaggedRevsHooks::onArticleDelete';
349351 # Check on undelete/merge for changes to stable version
350352 $wgHooks['ArticleMergeComplete'][] = 'FlaggedRevsHooks::updateFromMerge';
351353 $wgHooks['ArticleRevisionUndeleted'][] = 'FlaggedRevsHooks::updateFromRestore';
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -145,7 +145,16 @@
146146 wfProfileOut( __METHOD__ );
147147 return true;
148148 }
 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__ );
149155
 156+ return true;
 157+ }
 158+
150159 /**
151160 * Inject stable links on LinksUpdate
152161 */

Status & tagging log