r54533 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54532‎ | r54533 | r54534 >
Date:17:36, 6 August 2009
Author:brion
Status:deferred
Tags:
Comment:
Delay hook setup to avoid compatibility problems with ordering
when coexisting with MWSearch... we want MWSearch to be able to
take over the PrefixSearchBackend hook without disabling the
SearchGetNearMatch hook point.
Modified paths:
  • /trunk/extensions/TitleKey/TitleKey.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TitleKey/TitleKey.php
@@ -43,9 +43,18 @@
4444 $wgHooks['LoadExtensionSchemaUpdates'][] = 'TitleKey::schemaUpdates';
4545
4646 // 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';
4952
 53+function efTitleKeySetup() {
 54+ global $wgHooks;
 55+ $wgHooks['PrefixSearchBackend'][] = 'TitleKey::prefixSearchBackend';
 56+ $wgHooks['SearchGetNearMatch' ][] = 'TitleKey::searchGetNearMatch';
 57+}
 58+
5059 $dir = dirname(__FILE__) . '/';
5160 $wgExtensionMessagesFiles['TitleKey'] = $dir . 'TitleKey.i18n.php';
5261 $wgAutoloadClasses['TitleKey'] = $dir . 'TitleKey_body.php';

Follow-up revisions

RevisionCommit summaryAuthorDate
r54534Merge TitleKey updates from trunk through r54533:...brion17:38, 6 August 2009

Status & tagging log