SemanticMediaWiki / SemanticScribunto

Provides service functions to support the Scribunto extension
Other
24 stars 14 forks source link

SemanticScribunto abort mediawiki installation #35

Closed Reasno closed 7 years ago

Reasno commented 7 years ago

Setup and configuration

Issue

Scribunto extension must be registered in LocalSettings.php, thus it is not available during installation process. Meanwhile during installation all composer managed extensions are loaded.

SemanticScribunto then complaints:

Error: Semantic Scribunto requires Scribunto, please enable or install the extension first

I do know this is a very minor issue, but simply adding a installer check can help us who may want to reinstall mw or those who work on multiple wikis.

Thanks!

kghbln commented 7 years ago

There currently seem to be more issues with having the dependency specified upon install than without. See https://github.com/SemanticMediaWiki/SemanticScribunto/issues/12

mwjames commented 7 years ago

I'm rather unable to see the issue here. The error only appears because Scribunto isn't loaded (using the standard MW approache) because it doesn't make sense for this extension to be used if the required extension isn't loaded or activated in the first place.

The check (as indicated below) is only executed after the LocalSettings.php has been loaded (event wgExtensionFunctions) therefore for the installation the check itself isn't executed.

If you follow the standard instructions then:

Should not cause any issue.

Error: Semantic Scribunto requires Scribunto, please enable or install the extension first

https://github.com/SemanticMediaWiki/SemanticScribunto/blob/master/SemanticScribunto.php#L91-L94

The Installer.php notes:

"... want here is $wgHooks['LoadExtensionSchemaUpdates']. This won't work if the extension has hidden hook registration in $wgExtensionFunctions, but we're not opening that can of worms ..."

https://github.com/wikimedia/mediawiki/blob/5300df4838f68437c17d5d697de57a46f0b5e02c/includes/installer/Installer.php#L1398-L1403

As for the loading sequence: WebStart.php loads:

There currently seem to be more issues with having the dependency

Well, we can't make this a real dependency because no one cares to make it a real release, all we have is some pseudo REL* tags that are neither standard nor comply with semver.

oetterer commented 7 years ago

I set up a fresh wiki with core 1.27.1, installed Scribunto (as explained in https://www.mediawiki.org/wiki/Extension:Scribunto#Manual_installation), then SMW and SSC via composer. Works for me.

Note: I load Scribunto via

require_once "$IP/extensions/Scribunto/Scribunto.php";

Also, I have lua sandbox installed.

I will try with a core 1.28 next

Edit: Same with clean install of core 1.28. Cannot reproduce the problem. SSC loads correctly. Sry.

mwjames commented 7 years ago

Edit: Same with clean install of core 1.28. Cannot reproduce the problem. SSC loads correctly. Sry.

Thanks.

Reasno commented 7 years ago

For a single codebase with multiple localsettings.php (wiki farm) setup however, this is an issue. Composer packages are always loaded before LocalSettings.php.