Addshore created this task. Addshore added projects: Wikidata, wikidata-tech-focus. Restricted Application added a subscriber: Aklapper. |
Details
Created as the one remaining part of T183096: Use ExtensionRegistry instead of class_exists to check for enabled extensions.
This is blocked on CirrusSearch using Extension registration in the first place. T87892: Convert CirrusSearch to use extension registration
Wikibase use class_exists checks in tests as well as production code to check if a specific extension is enabled:
if ( !class_exists( 'CirrusSearch' ) ) {
This binds against a fully qualified class name in a super-problematic way that does not fail when the class is renamed or moved to another namespace.
This has already caused many regressions in other (related and unrelated) codebases.All these conditionals must be replaced with a proper check :
if ( !ExtensionRegistry::getInstance()->isLoaded( 'CirrusSearch' ) ) {See https://gerrit.wikimedia.org/r/398511 for an example.
ExtensionRegistry can only be used, when the extension to check is using extension.json
Impact & priority
This change could avoid confusion and regression in the future when class names get change or namespaces moved.
The task itself is easy to complete, so lets get it done as soon as possible.Task & Acceptance Criteria
- All occurrences of class_exists( 'CirrusSearch' ) (or another CirrusSearch class in Wikibase have been converted to use Extension Registration checks.
Cc: Addshore, Aklapper, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs