Page MenuHomePhabricator

HTMLFormFieldClone::getInputHTMLForKey is invoked with false $values parameter, array expected
Closed, ResolvedPublic

Description

Invalid operand type was used: array_key_exists expects an array or an object; false returned.
in /srv/mediawiki/php-1.28.0-wmf.14/includes/htmlform/fields/HTMLFormFieldCloner.php on line 274

https://github.com/wikimedia/mediawiki/blame/wmf/1.28.0-wmf.14/includes/htmlform/fields/HTMLFormFieldCloner.php#L274

Method HTMLFormFieldClone::getInputHTMLForKey expect $values to be an array, not false value.

See also ed12473b15.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 13 2016, 7:03 PM
Dereckson updated the task description. (Show Details)Aug 13 2016, 7:03 PM
Dereckson updated the task description. (Show Details)
Dereckson added a subscriber: Anomie.
Tgr added a comment.Aug 13 2016, 10:35 PM

Per the phpdoc $values must be an array, so the error is somewhere further down the call stack.

We don't currently have a stack trace.

Tgr added a comment.Aug 14 2016, 5:34 AM

Where does the error come from? I can't find it in logstash.

One likely case is https://phabricator.wikimedia.org/diffusion/MW/browse/master/includes/htmlform/fields/HTMLFormFieldCloner.php;06384c97f3d3fff2ca8615e4a53152845fcda810$357. The change from isset to array_key_exists in ed12473b would have had the side effect of causing this warning.

Change 304820 had a related patch set uploaded (by Anomie):
HTMLFormFieldCloner: Pass enpty array, not null, to avoid warning

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

Change 304820 merged by jenkins-bot:
HTMLFormFieldCloner: Pass enpty array, not null, to avoid warning

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

Change 304829 had a related patch set uploaded (by Florianschmidtwelzow):
Type hint array for HTMLFormFieldCloner::getInputHTMLForKey()

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

matmarex closed this task as Resolved.Aug 18 2016, 7:43 PM
matmarex assigned this task to Anomie.
matmarex removed a project: Patch-For-Review.
matmarex added a subscriber: matmarex.

Looks fixed, no recent hits in logstash.

Change 304829 merged by jenkins-bot:
Type hint array for HTMLFormFieldCloner::getInputHTMLForKey()

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