Page MenuHomePhabricator

ErrorException from line 197 of TimelessTemplate.php: PHP Warning: count(): Parameter must be an array or an object that implements Countable
Closed, ResolvedPublic

Description

Hi, with timeless on mediawiki 1.31 i am seeing this in the logs alot:

[25-May-2018 18:23:34 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /srv/mediawiki/w/skins/Timeless/TimelessTemplate.php on line 197
2018-05-25 18:23:34 test1 test1wiki: [d9a41fdcc296d73d327dc783] /wiki/Special:SpecialPages   ErrorException from line 197 of /srv/mediawiki/w/skins/Timeless/TimelessTemplate.php: PHP Warning: count(): Parameter must be an array or an object that implements Countable
#0 /srv/mediawiki/w/skins/Timeless/TimelessTemplate.php(197): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/w/skins/Timeless/TimelessTemplate.php(361): TimelessTemplate->getPortlet(string, string)
#2 /srv/mediawiki/w/skins/Timeless/TimelessTemplate.php(41): TimelessTemplate->getMainNavigation()
#3 /srv/mediawiki/w/includes/skins/SkinTemplate.php(251): TimelessTemplate->execute()
#4 /srv/mediawiki/w/includes/OutputPage.php(2388): SkinTemplate->outputPage()
#5 /srv/mediawiki/w/includes/MediaWiki.php(868): OutputPage->output(boolean)
#6 /srv/mediawiki/w/includes/MediaWiki.php(880): MediaWiki->{closure}()
#7 /srv/mediawiki/w/includes/MediaWiki.php(524): MediaWiki->main()
#8 /srv/mediawiki/w/index.php(42): MediaWiki->run()
#9 {main}

I think this was caused by https://github.com/wikimedia/mediawiki-skins-Timeless/commit/212357d9b8a58e0028c6ab521db42420460c81e8

Event Timeline

Change 435205 had a related patch set (by Paladox) published:
[mediawiki/skins/Timeless@master] Add is_array check for count()

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

Change 435205 merged by jenkins-bot:
[mediawiki/skins/Timeless@master] Fix $count to === against array instead of using count that fails

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

Change 436053 had a related patch set (by Paladox) published:
[mediawiki/skins/Timeless@REL1_31] Fix $count to === against array instead of using count that fails

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

Change 436053 merged by jenkins-bot:
[mediawiki/skins/Timeless@REL1_31] Fix $count to === against array instead of using count that fails

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

RazeSoldier subscribed.

@Paladox Can we mark this task as resolved?

Vvjjkkii renamed this task from ErrorException from line 197 of TimelessTemplate.php: PHP Warning: count(): Parameter must be an array or an object that implements Countable to m9baaaaaaa.Jul 1 2018, 1:08 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Paladox as the assignee of this task.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: gerritbot.
CommunityTechBot renamed this task from m9baaaaaaa to ErrorException from line 197 of TimelessTemplate.php: PHP Warning: count(): Parameter must be an array or an object that implements Countable.Jul 2 2018, 3:44 PM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to Paladox.
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: gerritbot.