Page MenuHomePhabricator

ExtensionRegistry::getInstance()->isLoaded( extension ) does not work as expected: it uses the given name, not the name as loaded
Open, Needs TriagePublicBUG REPORT

Description

I discovered that the function ExtensionRegistry::getInstance()->isLoaded( 'OpenIDConnect' ) does not work as expected
→ because it requires the match with the exact name of an extension as printed in extension.json

This appears not to be logical when coders have used for many years (for example) wfLoadExtension( 'OpenIDConnect' ):
→ they have to use ExtensionRegistry::getInstance->isLoaded( 'OpenID Connect') with a space

What I propose is to find a solution without a breaking change of the function for other users. At least I did my very best to inform the community about this (may happen again) problem when relying on ExtensionRegistry::getInstance()->isLoaded().

Event Timeline

Wikinaut renamed this task from ExtensionRegistry::getInstance()->isLoaded( extension ) does not work as expected: it use the given name, not the name as loaded to ExtensionRegistry::getInstance()->isLoaded( extension ) does not work as expected: it uses the given name, not the name as loaded.Feb 4 2024, 2:11 PM

I think the current behaviour makes much more sense.

I do agree its confusing that the extension.json name for OpenIDConnect doesn't match the common name of the extension, but I would suggest the solution here is that OpenIDConnect should change what it is called in extension.json.

Dear Brian, I think this, I would call it harmonization, should be then done then for _all_ extensions in the MediaWiki catalogue in order to have the same for all (name in wfLoadExtension and name in extension.json should not be different). Sooner or later, this will again create troubles.

(it costs me some hours for a stupid space)