r96660 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96659‎ | r96660 | r96661 >
Date:14:06, 9 September 2011
Author:catrope
Status:ok
Tags:
Comment:
RL2: When Gadget definition: pages are imported, we need to update the DB too. Fixed in a terrible way; this code really needs refactoring
Modified paths:
  • /branches/RL2/extensions/Gadgets/GadgetHooks.php (modified) (history)
  • /branches/RL2/extensions/Gadgets/Gadgets.php (modified) (history)

Diff [purge]

Index: branches/RL2/extensions/Gadgets/Gadgets.php
@@ -92,6 +92,7 @@
9393 'gadgets-definition-delete'
9494 ) );
9595
 96+$wgHooks['AfterImportPage'][] = 'GadgetHooks::gadgetDefinitionImport';
9697 $wgHooks['ArticleDeleteComplete'][] = 'GadgetHooks::gadgetDefinitionDelete';
9798 $wgHooks['ArticleDeleteComplete'][] = 'GadgetHooks::cssJsPageDelete';
9899 $wgHooks['ArticleSaveComplete'][] = 'GadgetHooks::gadgetDefinitionSave';
Index: branches/RL2/extensions/Gadgets/GadgetHooks.php
@@ -118,6 +118,14 @@
119119 // but we do't care, see similar comment in articleSaveComplete()
120120 return true;
121121 }
 122+
 123+ public static function gadgetDefinitionImport( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) {
 124+ // HACK: AAAAAAARGH. Should fix this duplication properly
 125+ // Logic is the same as in gadgetDefinitionUndelete() and that function only uses the $title parameter
 126+ // Shit, shit, shit, this is ugly
 127+ self::gadgetDefinitionUndelete( $title, true, '' );
 128+ return true;
 129+ }
122130
123131 /**
124132 * ArticleDeleteComplete hook handler.

Status & tagging log