Index: trunk/extensions/TitleKey/TitleKey.php |
— | — | @@ -43,9 +43,18 @@ |
44 | 44 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'TitleKey::schemaUpdates'; |
45 | 45 | |
46 | 46 | // Search hooks... |
47 | | -$wgHooks['PrefixSearchBackend'][] = 'TitleKey::prefixSearchBackend'; |
48 | | -$wgHooks['SearchGetNearMatch' ][] = 'TitleKey::searchGetNearMatch'; |
| 47 | +// Delay setup to avoid compatibility problems with hook ordering |
| 48 | +// when coexisting with MWSearch... we want MWSearch to be able to |
| 49 | +// take over the PrefixSearchBackend hook without disabling the |
| 50 | +// SearchGetNearMatch hook point. |
| 51 | +$wgExtensionFunctions[] = 'efTitleKeySetup'; |
49 | 52 | |
| 53 | +function efTitleKeySetup() { |
| 54 | + global $wgHooks; |
| 55 | + $wgHooks['PrefixSearchBackend'][] = 'TitleKey::prefixSearchBackend'; |
| 56 | + $wgHooks['SearchGetNearMatch' ][] = 'TitleKey::searchGetNearMatch'; |
| 57 | +} |
| 58 | + |
50 | 59 | $dir = dirname(__FILE__) . '/'; |
51 | 60 | $wgExtensionMessagesFiles['TitleKey'] = $dir . 'TitleKey.i18n.php'; |
52 | 61 | $wgAutoloadClasses['TitleKey'] = $dir . 'TitleKey_body.php'; |