Page MenuHomePhabricator

Warning: Invalid argument supplied for foreach() in classes/View.php on line 507
Closed, ResolvedPublic

Description

I thought I had already filed this one but maybe I mixed up with another extension or even T96422/T37865.

[11-Jun-2018 16:52:54 UTC] PHP Warning:  Invalid argument supplied for foreach() in /srv/mediawiki/tags/2018-06-06_05:52:45/extensions/LiquidThreads/classes/View.php on line 505

Event Timeline

Nemo_bis created this task.Jul 28 2016, 4:49 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 28 2016, 4:49 PM
Jdforrester-WMF triaged this task as Lowest priority.Aug 4 2016, 11:33 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

LiquidThreads has been replaced by StructuredDiscussions on all Wikimedia production wikis (except one, which will be done soon). It is no longer under active development or maintenance, so I'm re-classifying all open LQT tasks as "Lowest" priority.

Nemo_bis raised the priority of this task from Lowest to Medium.Aug 5 2016, 7:11 AM
Reedy renamed this task from Warning: Invalid argument supplied for foreach() in classes/View.php on line 471 to Warning: Invalid argument supplied for foreach() in classes/View.php on line 505.Jun 11 2018, 6:54 PM
Reedy updated the task description. (Show Details)
Reedy added a subscriber: MarcoAurelio.
Krinkle moved this task from Untriaged to Found longer ago on the Wikimedia-production-error board.
Krinkle added a subscriber: Krinkle.

Recent sample:

  • Request ID: XRKyCgpAIDUAABjVY-cAAAAD
message
PHP Warning: Invalid argument supplied for foreach()
trace
#0 /srv/mediawiki/php-1.34.0-wmf.10/extensions/LiquidThreads/classes/View.php(507): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.34.0-wmf.10/extensions/LiquidThreads/api/ApiThreadAction.php(799): LqtView::getInlineEditForm(Article, string, NULL)
#2 /srv/mediawiki/php-1.34.0-wmf.10/extensions/LiquidThreads/api/ApiThreadAction.php(55): ApiThreadAction->actionInlineEditForm(array, array)
#3 /srv/mediawiki/php-1.34.0-wmf.10/includes/api/ApiMain.php(1595): ApiThreadAction->execute()
#4 /srv/mediawiki/php-1.34.0-wmf.10/includes/api/ApiMain.php(531): ApiMain->executeAction()
#5 /srv/mediawiki/php-1.34.0-wmf.10/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#6 /srv/mediawiki/php-1.34.0-wmf.10/api.php(87): ApiMain->execute()
Daimona added a subscriber: Daimona.Jul 8 2019, 9:28 AM

I checked this code, and can't figure out how is that supposed to work. The foreach iterates over $request->getSessionArray(), which will return null if $request->sessionId is unset. AFAICS, nothing in the LQT thread is initializing the sessionId, either by passing in a Session object or something like that. So, is $request->getSessionArray always null?! It could be due to some refactoring that was made in 2016, I guess...

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM
Nikerabbit renamed this task from Warning: Invalid argument supplied for foreach() in classes/View.php on line 505 to Warning: Invalid argument supplied for foreach() in classes/View.php on line 507.Oct 16 2019, 12:36 PM

Change 545781 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/LiquidThreads@master] Silence PHP warning in classes/View.php

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

Change 545781 merged by jenkins-bot:
[mediawiki/extensions/LiquidThreads@master] Silence PHP warning in classes/View.php

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

Krinkle removed a subscriber: Krinkle.Oct 25 2019, 12:26 AM

Change 545984 had a related patch set uploaded (by Krinkle; owner: Nikerabbit):
[mediawiki/extensions/LiquidThreads@wmf/1.35.0-wmf.3] Silence PHP warning in classes/View.php

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

Change 545984 merged by jenkins-bot:
[mediawiki/extensions/LiquidThreads@wmf/1.35.0-wmf.3] Silence PHP warning in classes/View.php

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

Nikerabbit closed this task as Resolved.Apr 3 2020, 6:52 AM

No more appearing in Logstash.