I was having these issues upgrading on a test server:
- MW 1.39.1
- PHP 8.0.20
- MariaDB 10.5.16-MariaDB
- SMW 4.1.0
... so I installed my working PRD wiki on the test server and confirmed things generally worked.
Here's my PRD server config where all is working nicely for a few years now:
- MediaWiki 1.35.1 (204e59b)
- PHP 7.4.16 (fpm-fcgi)
- MariaDB 10.4.18-MariaDB
- SMW 3.2.2
// NOTE: wfLoadExtension( 'SemanticMediaWiki' ); is NOT invoked in the PRD wiki, as it's not needed (contrary to some of the doc saying that it is as of SMW 3.2.2 I think) ______________________
Anyway, I installed MW from tarball and all extensions I use via Composer as usual, and Special:SpecialPages and Special:UserLogin were broken with only some benign PHP deprecated messages.
After troubleshooting many things, I decided to try again and establish that MW 1.39.1 was working 'okay' on the test server under Monobook skin. From here, I installed Chameleon 4.2.1, and all was dandy under that skin. Special:SpecialPages and Special:UserLogin worked fine.
Then I installed Page Forms 5.5.1 and SMW 4.1.0 and all seemed 'okay' until I went to Special:SpecialPages, which displayed nothing but my site header (as did Special:UserLogin). Here's my invocation in LocalSettings.php:
wfLoadExtension( 'SemanticMediaWiki' ); enableSemantics( 'myurl.org' ); $smwgNamespace = 'http://myurl.org/id/';
// NOTE: wfLoadExtension( 'SemanticMediaWiki' );
I learned that it must be invoked again now (back and forth I guess), so I did so.
______________________
I know it's SMW now, because this edit to LocalSettings.php resolves:
//wfLoadExtension( 'SemanticMediaWiki' ); enableSemantics( 'myurl.org' ); $smwgNamespace = 'http://myurl.org/id/';
... even though I get SMW errors elsewhere, and my Special Pages work. Needless to say, I'm looking for any suggestions to resolve.
Here's my PHP messages from Special Pages invoked ONLY when SMW is loaded:
Warning : foreach() argument must be of type array|object, null given in /srv/sites/_wiki/includes/skins/BaseTemplate.php on line 257 Warning : foreach() argument must be of type array|object, null given in /srv/sites/_wiki/includes/skins/BaseTemplate.php on line 257 Warning : foreach() argument must be of type array|object, null given in /srv/sites/_wiki/skins/chameleon/src/ChameleonTemplate.php on line 160
... so looks like issues with MW skins in general and Chameleon included. I have not tested if these issues persist without the Chameleon skin, but that will be my next task when I have the will to push forward (but that seems redundant, given these warnings).
Thanks
___________________
Tested under Monobook skin (Chameleon/Bootstrap disabled) produces the same problem and gives stack trace:
[3ee04010f39f3ec2a7447353] /wiki/Special:SpecialPages TypeError: SMW\MessageFormatter::__construct(): Argument #1 ($language) must be of type Language, StubUserLang given, called in /srv/sites/_wiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php on line 133 Backtrace: from /srv/sites/_wiki/extensions/SemanticMediaWiki/includes/formatters/MessageFormatter.php(48) #0 /srv/sites/_wiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(133): SMW\MessageFormatter->__construct() #1 /srv/sites/_wiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(178): SMW\ParserFunctionFactory->newAskParserFunction() #2 /srv/sites/_wiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(421): SMW\ParserFunctionFactory->newShowParserFunction() #3 /srv/sites/_wiki/includes/parser/Parser.php(3443): SMW\ParserFunctionFactory->SMW\{closure}() #4 /srv/sites/_wiki/includes/parser/Parser.php(3126): Parser->callParserFunction() #5 /srv/sites/_wiki/includes/parser/PPFrame_Hash.php(276): Parser->braceSubstitution() #6 /srv/sites/_wiki/includes/parser/Parser.php(2955): PPFrame_Hash->expand() #7 /srv/sites/_wiki/includes/parser/Parser.php(962): Parser->replaceVariables() #8 /srv/sites/_wiki/includes/parser/Parser.php(4928): Parser->preprocess() #9 /srv/sites/_wiki/includes/language/MessageCache.php(1308): Parser->transformMsg() #10 /srv/sites/_wiki/includes/skins/Skin.php(1586): MessageCache->transform() #11 /srv/sites/_wiki/includes/skins/Skin.php(1552): Skin->addToSidebarPlain() #12 /srv/sites/_wiki/includes/skins/Skin.php(1495): Skin->addToSidebar() #13 /srv/sites/_wiki/includes/skins/Skin.php(1527): Skin->{closure}() #14 /srv/sites/_wiki/includes/skins/SkinTemplate.php(792): Skin->buildSidebar() #15 /srv/sites/_wiki/includes/skins/SkinTemplate.php(229): SkinTemplate->getPortletsTemplateData() #16 /srv/sites/_wiki/includes/skins/SkinMustache.php(88): SkinTemplate->getTemplateData() #17 /srv/sites/_wiki/includes/skins/SkinMustache.php(58): SkinMustache->getTemplateData() #18 /srv/sites/_wiki/includes/skins/SkinTemplate.php(177): SkinMustache->generateHTML() #19 /srv/sites/_wiki/includes/OutputPage.php(2874): SkinTemplate->outputPage() #20 /srv/sites/_wiki/includes/MediaWiki.php(922): OutputPage->output() #21 /srv/sites/_wiki/includes/MediaWiki.php(562): MediaWiki->main() #22 /srv/sites/_wiki/index.php(50): MediaWiki->run() #23 /srv/sites/_wiki/index.php(46): wfIndexMain() #24 {main}