4

I'm using: MediaWiki 1.30.0 PHP 7.4.1 (apache2handler) MariaDB 10.3.21-MariaDB-1:10.3.21+maria~jessie

I get this error a lot on the log:

-PHP Notice:  Trying to access array offset on value of type null in .../wiki/includes/profiler/SectionProfiler.php on line 99
-PHP Notice:  Trying to access array offset on value of type null in .../wiki/includes/profiler/SectionProfiler.php on line 100
-PHP Notice:  Trying to access array offset on value of type null in .../wiki/includes/profiler/SectionProfiler.php on line 101

I try to google this, but it often sent me to other MediaWiki sites with this notice instead of a discussion of the issue.

Regards

Piotr P. Karwasz
  • 5,292
  • 2
  • 9
  • 20

1 Answers1

6

I had the same problem when updating XAMPP from PHP 7.2.2 to PHP 7.4.1, while keeping MediaWiki at version 1.30.0. A comparison of the file includes/profiler/SectionProfiler.php with the one in the current MediaWiki version 1.34.0 showed that this warning was fixed (commit). So I just replaced the file by the new version and the then messages where gone (the change happens to be backward compatible).

Timo Tijhof
  • 107
  • 2
user558289
  • 61
  • 1
  • I tried the solution but unfortunately it didn't work for me. What's weird for me is that after the page is loaded the error is there, but when you reload via CTRL + F5 the message(s) is/are gone. Any other ideas how to fix this? Thank you! – MaxMustemal May 21 '21 at 10:52
  • @MaxMustemal The solution worked for me. I'm just wondering if you just copy & paste the file on the link? If you did, you might have missed that you should remove 3 lines that start with `$totalCpu`, `$totalReal` & `$totalMem`. These 3 lines were replace by the `if else` statement following it. – Gellie Ann Oct 11 '21 at 02:41