Jump to content

Topic on Project:Support desk

[updated] filed as bug https://phabricator.wikimedia.org/T356596

Problem: ...->isLoaded( extension ) always returns false, also if that extension is loaded.

Situation:

  • mediawiki 1.41.0

In my extension ShowOIDCIdentity I need to check whether the dependency extension OpenIDConnect is really loaded.

This done in that way previously in LocalSettings:

wfLoadExtension( 'OpenIDConnect' );
...
wfLoadExtension( 'ShowOIDCIdentity' );

myextension/Hooks.php;

Namespace MediaWiki\Extension\ShowOIDCIdentity;
use ExtensionRegistry;

class Hooks {
/**
  * @param User $user
  * @param array $preferences
  */
public static function onGetPreferences( $user, &$preferences ) {

if ( ExtensionRegistry::getInstance()->isLoaded( 'OpenIDConnect' ) )

/*** is always false even if OpenIDConnect is correctly loaded and working ***/

I cannot find a problem here, but it is not working.