Index: branches/RL2/extensions/Gadgets/Gadgets.php |
— | — | @@ -92,6 +92,7 @@ |
93 | 93 | 'gadgets-definition-delete' |
94 | 94 | ) ); |
95 | 95 | |
| 96 | +$wgHooks['AfterImportPage'][] = 'GadgetHooks::gadgetDefinitionImport'; |
96 | 97 | $wgHooks['ArticleDeleteComplete'][] = 'GadgetHooks::gadgetDefinitionDelete'; |
97 | 98 | $wgHooks['ArticleDeleteComplete'][] = 'GadgetHooks::cssJsPageDelete'; |
98 | 99 | $wgHooks['ArticleSaveComplete'][] = 'GadgetHooks::gadgetDefinitionSave'; |
Index: branches/RL2/extensions/Gadgets/GadgetHooks.php |
— | — | @@ -118,6 +118,14 @@ |
119 | 119 | // but we do't care, see similar comment in articleSaveComplete() |
120 | 120 | return true; |
121 | 121 | } |
| 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 | + } |
122 | 130 | |
123 | 131 | /** |
124 | 132 | * ArticleDeleteComplete hook handler. |