Page MenuHomePhabricator

Invalid operand type was used: array_flip expects an array or collection in ApiResult
Closed, ResolvedPublic

Description

Invalid operand type was used: array_flip expects an array or collection
in /srv/mediawiki/php-1.28.0-wmf.22/includes/api/ApiResult.php on line 844

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 27 2016, 2:07 AM
Anomie added a subscriber: Anomie.Oct 27 2016, 2:01 PM

Without a backtrace or an API request that reproduces the warning, the only option would be for someone to grep through all deployed code to try to find what might be setting META_BC_BOOLS to something that's not an array.

Change 318297 had a related patch set uploaded (by Anomie):
Value for ApiResult::META_BC_BOOLS must be an array

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

Should we have ApiResult throw an UnexpectedValueException or something in this case? Or silently fail here?

Change 318297 merged by jenkins-bot:
Value for ApiResult::META_BC_BOOLS must be an array

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

Should we have ApiResult throw an UnexpectedValueException or something in this case? Or silently fail here?

It's a tradeoff between adding more code complexity checking types to guard against people making mistakes, and just trusting people not to make mistakes. If we do anything, UnexpectedValueException would probably be best.

Change 318341 had a related patch set uploaded (by Legoktm):
Value for ApiResult::META_BC_BOOLS must be an array

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

Change 318341 merged by jenkins-bot:
Value for ApiResult::META_BC_BOOLS must be an array

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

Legoktm closed this task as Resolved.Oct 27 2016, 6:26 PM
Legoktm claimed this task.

Okay, I'll mark as resolved for now.

Legoktm reassigned this task from Legoktm to Anomie.Oct 27 2016, 6:27 PM
Legoktm added a project: AbuseFilter.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM