Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to deprecate ExtensionRegistry->load #47

Merged
merged 5 commits into from
Sep 28, 2020

Conversation

hexmode
Copy link
Member

@hexmode hexmode commented Aug 28, 2020

Setup and configuration

  • MW version: 1.33/1.34?

Issue

https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/504032/

$registry = new ExtensionRegistry();
if ( file_exists( __DIR__ . '/extensions/Lingo/extension.json' ) ) {
$registry->load( __DIR__ . '/extensions/Lingo/extension.json' );
} else {
$registry->load( $GLOBALS[ 'wgExtensionDirectory' ] . '/Lingo/extension.json' );
}

@s7eph4n s7eph4n added the bug label Apr 23, 2019
@s7eph4n
Copy link
Contributor

s7eph4n commented Apr 23, 2019

Thanks!

Guess we'll have to use queue() + loadFromQueue() ourselves.
Alternatively we could require users to explicitly enable Lingo themselves.

@mwjames
Copy link
Contributor Author

mwjames commented Apr 23, 2019 via email

@kghbln
Copy link
Member

kghbln commented Jun 21, 2020

SG is now failing for MW 1.34+ as reported on MediaWiki.org

@kghbln
Copy link
Member

kghbln commented Aug 22, 2020

Interestingly SG master was not failing for me on MW 1.34. However SG 3.0.0 is failing on MW 1.35 with the following fatal issued twice:

PHP Fatal error:  Uncaught Error: Call to undefined method ExtensionRegistry::load() in /../w/extensions/SemanticGlossary/SemanticGlossary.php:27

Stack trace:

#0 /../w/includes/registration/ExtensionRegistry.php(541): SemanticGlossary::initExtension(Array)
#1 /../w/includes/registration/ExtensionRegistry.php(232): ExtensionRegistry->exportExtractedData(Array)
#2 /../w/includes/Setup.php(161): ExtensionRegistry->loadFromQueue()
#3 /../w/maintenance/doMaintenance.php(91): require_once('/var/www/html/s...')
#4 /../w/maintenance/update.php(253): require_once('/var/www/html/s...')
#5 {main}
  thrown in /../w/extensions/SemanticGlossary/SemanticGlossary.php on line 27

@hexmode
Copy link
Member

hexmode commented Sep 8, 2020

I'm not sure how to address the failures. This one is confusing:

1) SG\Tests\Integration\MwDBSQLStoreIntegrationTest::testPageCreateDeleteStoreIntegration

TypeError: Return value of SG\Tests\Integration\MwDBSQLStoreIntegrationTest::setUp() must be an instance of SG\Tests\Integration\void, none returned

@hexmode
Copy link
Member

hexmode commented Sep 8, 2020

Ah... That one is saying it needs 7.1.

7.2 is confusing, though.

PHP Fatal error:  Declaration of Mock_DIWikiPage_c1bf0d64::isSubEntityOf(string $prefix) must be compatible with SMW\DIWikiPage::isSubEntityOf(string $prefix): bool in /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php(290) : eval()'d code on line 1

I imagine that is a problem with phpunit or php-mocks, but I don't know what to do.

@hexmode
Copy link
Member

hexmode commented Sep 8, 2020

pinging @JeroenDeDauw in case he has a clue.

@JeroenDeDauw
Copy link
Member

Error hints at missing boolean return type.

Perhaps the issue is too old PHPUnit for newer PHP version? Seen some of that in various places in recent history. Can just upgrade PHPUnit in that case

@hexmode
Copy link
Member

hexmode commented Sep 8, 2020

Perhaps the issue is too old PHPUnit for newer PHP version?

Looks like it needs phpunit 5+

@@ -37,6 +37,9 @@
"mediawiki/semantic-media-wiki": "^2.4|^3.0",
"mediawiki/lingo": "^2.0.3|^3.0"
},
"require-dev": {
"phpunit/phpunit": "^6.5"
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is good for

@kghbln kghbln merged commit 56799ca into master Sep 28, 2020
@kghbln kghbln deleted the deprecate-extension-registry-load branch September 28, 2020 09:31
@kghbln
Copy link
Member

kghbln commented Sep 28, 2020

Since we got relevant approval I just merged. A field test showed that the fatal for MW 1.35 is resolved. However I am not sure if the extension is still working as expected. This may be a separate issue.

@Hannes-Ole
Copy link

I found this issue following the extension talks where SemanticGlossary was labeled "Broken" with 1.34. Also googling the above mentioned error led me here, I'm producing it with a rather fresh installation of MediaWiki 1.35 and SemanticMediaWiki 3.2.2:

Uncaught Error: Call to undefined method ExtensionRegistry::load() in SemanticGlossary

This is my environment (when disabling wfLoadExtension('SemanticGlossary') everything works fine): https://wiki.waldmonitoring.ch/index.php/Spezial:Version

I hope this is the right place to mention this...

The full error code is:

Fatal error: Uncaught Error: Call to undefined method ExtensionRegistry::load() in /var/www/webroot/ROOT/extensions/SemanticGlossary/SemanticGlossary.php:27 Stack trace: #0 /var/www/webroot/ROOT/includes/registration/ExtensionRegistry.php(541): SemanticGlossary::initExtension(Array) #1 /var/www/webroot/ROOT/includes/registration/ExtensionRegistry.php(232): ExtensionRegistry->exportExtractedData(Array) #2 /var/www/webroot/ROOT/includes/Setup.php(161): ExtensionRegistry->loadFromQueue() #3 /var/www/webroot/ROOT/includes/WebStart.php(89): require_once('/var/www/webroo...') #4 /var/www/webroot/ROOT/index.php(44): require('/var/www/webroo...') #5 {main} thrown in /var/www/webroot/ROOT/extensions/SemanticGlossary/SemanticGlossary.php on line 27

@hexmode
Copy link
Member

hexmode commented Jan 21, 2021

I found this issue following the extension talks where SemanticGlossary was labeled "Broken" with 1.34. Also googling the above mentioned error led me here, I'm producing it with a rather fresh installation of MediaWiki 1.35 and SemanticMediaWiki 3.2.2:

Uncaught Error: Call to undefined method ExtensionRegistry::load() in SemanticGlossary

Did you try using the latest from git (e.g. "dev-master" in composer.local.json)?

@Hannes-Ole
Copy link

Thank you for answering. I tried, but that didn't fix it.
I tried via
git clone https://github.com/SemanticMediaWiki/SemanticGlossary.git
This resulted in error (Semantic Glossary requires Lingo to be installed.)
Manual install of Lingo (via composer.local.json):
"mediawiki/lingo": "~3.0",
didn't resolve this until adding #wfLoadExtension( 'Lingo' ); to LocalSettings.php (against SemanticGlossary recommendation) That removed the dependency error and leaves the wiki functional, but with a php-error displayed on top:

Warning: Invalid argument supplied for foreach() in /var/www/webroot/ROOT/extensions/Lingo/src/Lingo.php on line 76

Then deinstalled both (Lingo via composer and SemanticGlossary manually) and added:
"mediawiki/semantic-glossary": "dev-master"
to composer.local.json and ran composer update
again resulted in dependency error (Semantic Glossary requires Lingo to be installed.)
Again installed Lingo manually with
"mediawiki/lingo": "dev-master",
Dependency error persisted until adding #wfLoadExtension( 'Lingo' ); to LocalSettings.php

Again this removes the dependency error and leaves the wiki functional, but with a similar php-error displayed on top (this time line 89 instead of 76):

Warning: Invalid argument supplied for foreach() in /var/www/webroot/ROOT/extensions/Lingo/src/Lingo.php on line 89

The dependency error displayed when Lingo is NOT manually installed/loaded reads:

Semantic Glossary requires Lingo to be installed.
Version
Semantic MediaWiki:
3.2.2 (smw:2020-04-18)
MediaWiki:
1.35.0
Code:
ERROR_EXTENSION_DEPENDENCY

and gives advice about adding enableSemantics in LocalSettings.php, but this is already done (before adding wfLoadExtension( 'SemanticGlossary' );)

@kghbln
Copy link
Member

kghbln commented Jan 25, 2021

In the meantime a new issue was created #56

@Hannes-Ole
Copy link

Hannes-Ole commented Jan 25, 2021

Thanks for pointing it out. So MW 1.35+ is "officially" not supported yet.
Moving to "dev-master" removes the error Uncaught Error: Call to undefined method ExtensionRegistry::load() in SemanticGlossary but requires manual installation and enabling of Lingo. Also there seems to be a problem with the Lingo code.
The php error is only displayed on the "Special:Version" page... is it safe to use SemanticGlossary in the combination:

		"mediawiki/lingo": "dev-master",
		"mediawiki/semantic-glossary": "dev-master"

or should I rather wait until 1.35+ is supported?

@kghbln
Copy link
Member

kghbln commented Jan 25, 2021

So MW 1.35+ is "officially" not supported yet.

That's a good way of putting it. I hope that a withe night shows up to make this happen to allow users of MW 1.31 an upgrade path. Until then it does not make sense to have it on MW 1.35

I cannot remember why I de-installed this extension on sandbox for a second time however I once got it working on MW 1.35 but it did not show tooltips at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants