Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions SemanticCompoundQueries.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use MediaWiki\MediaWikiServices;

/**
* @see https://github.com/SemanticMediaWiki/SemanticCompoundQueries/
*
Expand Down Expand Up @@ -63,12 +65,13 @@ public static function onExtensionFunction() {
$GLOBALS['wgAPIModules']['compoundquery'] = 'SCQ\Api\CompoundQuery';

// wgHooks
$GLOBALS['wgHooks']['ParserFirstCallInit'][] = function( Parser &$parser ) {
$hookContainer = MediaWikiServices::getInstance()->getHookContainer();
$hookContainer->register( 'ParserFirstCallInit', function( Parser &$parser ) {
$parser->setFunctionHook( 'compound_query', [ '\SCQ\CompoundQueryProcessor', 'doCompoundQuery' ] );

// always return true, in order not to stop MW's hook processing!
return true;
};
} );
}

/**
Expand Down