Topic on Talk:MediaWiki 1.39

MW 1.39.6 full of null warnings

5
Jakeriper1 (talkcontribs)

"Trying to access array offset on value of type null" is the type of warning i'm getting of several pages.

sooo, why am i getting so many warnings on a LTS, fresh install of MediaWiki?

i installed the wiki on a server with php 8.2. is the LTS not tested on this version of php?

Tacsipacsi (talkcontribs)

MediaWiki 1.39 was released on 30 November 2022, PHP 8.2 eight days later, so no one could test MW 1.39 on PHP 8.2 before the release, and probably no one tested it after the release either.

On the other hand, I don’t know about any changes in PHP 8.2 that could cause these warnings, so it’s likely that it would affect older PHP versions as well. Which file/line do these warnings refer to? Do you have any extensions installed?

Jakeriper1 (talkcontribs)

EDIT: finding more as i work on the wiki:

vendor/wikimedia/wait-condition-loop/src/WaitConditionLoop.php on line 169 (on the main page)

vendor\wikimedia/request-timeout/src/Detail/BasicRequestTimeout.php on line 35

includes/parser/ParserOutput.php on line 1786 (on multiple special pages)

includes/profiler/SectionProfiler.php on line 297


(not sure if there's more - i've seen more, but i've also been installing different MediaWiki versions, and switching PHP versions on my local installation, ir order to upgrade the database of an old wiki to 1.39.6 - maybe i'd have to go through more of the wiki's pages, but these two are quite common on a fresh 1.39.6 MW install with PHP 8.2)


as for extensions i have just a few: JSBreadCrumbs, LinkTitles, WikiEditor and YouTube

Jakeriper1 (talkcontribs)

all these "nulls" have to do with getrusage() or something in that function;

got to dig deeper

Jakeriper1 (talkcontribs)

dunno why the code isn't setting the expected variable as an array here, but the wiki seems working fine, so i'll wait until the next LTS and upgrade, hopefully this will be fixed by then.

i just hid the error, if anyone's interested, with isset and is_array.


if (isset($ru) || is_array($ru)) { run whatever the function has to run that uses $ru }

Reply to "MW 1.39.6 full of null warnings"