Page MenuHomePhabricator

LinkedWiki not compatible with wmf/1.41.0-wmf.29
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Test Linked wiki with wmf/1.41.0-wmf.27 (everything works as expected)
  • Update core to wmf/1.41.0-wmf.29

What happens?:

One sees the following error

Original exception: [8064365f94f428160b54fff6] /wiki/Main_Page Error: Typed property Parser::$mOutput must not be accessed before initialization
Backtrace:
from /var/www/html/includes/parser/Parser.php(1049)
#0 /var/www/html/extensions/LinkedWiki/LinkedWikiStatus.php(220): Parser->getOutput()
#1 /var/www/html/extensions/LinkedWiki/LinkedWiki.php(25): LinkedWikiStatus::clearPagePropertiesViaParser(Parser)
#2 /var/www/html/includes/HookContainer/HookContainer.php(161): LinkedWiki::parserFirstCallInit(Parser)
#3 /var/www/html/includes/HookContainer/HookRunner.php(2955): MediaWiki\HookContainer\HookContainer->run(string, array)
#4 /var/www/html/includes/parser/Parser.php(490): MediaWiki\HookContainer\HookRunner->onParserFirstCallInit(Parser)
#5 /var/www/html/includes/parser/ParserFactory.php(220): Parser->__construct(MediaWiki\Config\ServiceOptions, MediaWiki\Parser\MagicWordFactory, LanguageEn, ParserFactory, MediaWiki\Utils\UrlUtils, MediaWiki\SpecialPage\SpecialPageFactory, MediaWiki\Linker\LinkRendererFactory, MediaWiki\Title\NamespaceInfo, MediaWiki\Logger\LegacyLogger, MediaWiki\Page\File\BadFileLookup, MediaWiki\Languages\LanguageConverterFactory, MediaWiki\HookContainer\HookContainer, MediaWiki\Tidy\RemexDriver, WANObjectCache, MediaWiki\User\UserOptionsManager, MediaWiki\User\UserFactory, MediaWiki\Title\MediaWikiTitleCodec, MediaWiki\Http\HttpRequestFactory, MediaWiki\Category\TrackingCategories, MediaWiki\Preferences\SignatureValidatorFactory, MediaWiki\User\UserNameUtils)

What should have happened instead?:

It should work as before

Software version (skip for WMF-hosted wikis like Wikipedia):

See https://github.com/MaRDI4NFDI/docker-wikibase/commit/0139513101c8d20559866e800e363a315241d0f0

Other information (browser name/version, screenshots, etc.):

Event Timeline

Karima subscribed.

@Physikerwelt The hook ParserFirstCallInit seems to be deprecated in the future but I don't know, if it supported again or not in the version 1.41. Try to stay on the version 1.39 of Mediawiki. I have to do the migration on PHP8 in 2024. I will test the extension on the future release 1.41 in same time.

Thank you. We follow WMF branches with our project, so downgrading to 1_39 is not an option. I believe ParserFirstCallInit will not come back T250444. Probably you can find other extensions that have already fixed the same problem with code search.

Just one side comment: I decided to postpone the migration to PHP8 on my desk as long as the WMF wikis run php7.

Change 964067 had a related patch set uploaded (by Karima Rafes; author: Karima Rafes):

[mediawiki/extensions/LinkedWiki@master] Quick fix for T348223

https://gerrit.wikimedia.org/r/964067

Change 964067 merged by Karima Rafes:

[mediawiki/extensions/LinkedWiki@master] Quick fix for T348223

https://gerrit.wikimedia.org/r/964067

@Physikerwelt In theory, it's fixed. I will check the other problems on 1.41 this weekend.

@Physikerwelt I detected only little bugs (in advanced tools with lua and the RDF export) with the version 1.40. I will fix it this month.
For 1.41, I cannot execute my tests (I use only the REL_X branchs in my scripts for mediawiki and also extensions...). Can you test of your side if this problem is always visible?

Sorry it took a while to get back to it. I am at 1.42. now, but it is probably the same problem

Original exception: [4025bb6e37bc2cf8735a80b1] /wiki/Main_Page Error: Typed property Parser::$mOutput must not be accessed before initialization
Backtrace:
from /Users/physikerwelt/git/mediawiki/mediawiki/includes/parser/Parser.php(1052)
#0 /Users/physikerwelt/git/mediawiki/mediawiki/extensions/LinkedWiki/LinkedWikiStatus.php(223): Parser->getOutput()
#1 /Users/physikerwelt/git/mediawiki/mediawiki/extensions/LinkedWiki/LinkedWiki.php(25): LinkedWikiStatus::clearPagePropertiesViaParser(Parser)

That the error message changed from line 220 to line 223 is caused by this fix https://gerrit.wikimedia.org/r/c/mediawiki/extensions/LinkedWiki/+/964067/1/LinkedWikiStatus.php

Physikerwelt triaged this task as Low priority.

I still get the same error message. However, I disabled LinkedWiki for now, so lowering priority.

@Physikerwelt I'm testing the branch REL_1_41 at each update. I don't see this error after my last update. Without error, I cannot fix it.
https://github.com/BorderCloud/mediawiki-extension-LinkedWiki-CI/actions/runs/6977216666

Do you use the version of LinkedWiki in the master branch? If yes, the hook ParserClearState initializes always the object Parser in this new core?
I'm not an expert of Core of Mediawiki. If you have a better hook to avoid this problem at each update of core, don't hesite to say me what is the best hook to use.

Ah I was using Version REL_1_41, I'll update to master, and test again.

Yes, that was the problem. Now running with 1.42-wmf.5

I observed this exact error with the extension Lingo, but it comes from a change introduced in MW 1.41.0, see T357686.