Last modified: 2013-10-19 11:32:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49341, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47341 - PHP Warning: in_array() expects parameter 2 to be array, null given in HTMLForm.php on line 2020
PHP Warning: in_array() expects parameter 2 to be array, null given in HTMLF...
Status: NEW
Product: MediaWiki
Classification: Unclassified
HTMLForm (Other open bugs)
1.22.0
All All
: Low trivial (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-17 22:52 UTC by Sam Reed (reedy)
Modified: 2013-10-19 11:32 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Reed (reedy) 2013-04-17 22:52:53 UTC
Warning:  in_array() expects parameter 2 to be array, null given in /usr/local/apache/common-local/php-1.22wmf2/includes/HTMLForm.php on line 2020
Comment 1 Luis Felipe Schenone 2013-05-02 12:59:10 UTC
According to the documentation and the actual code, that second parameter comes from HTMLFormField::flattenOptions, which only returns arrays. When did you encounter the bug, how can I reproduce it? Thanks.
Comment 2 Sam Reed (reedy) 2013-05-02 14:28:03 UTC
Yes, this is still happening on Wikimedia projects (seen the warning this week a few times)

I encountered the bug around the time I logged the bug report

No, I don't know how to reproduce the bug

No, I don't have a stack trace
Comment 3 Luis Felipe Schenone 2013-05-02 16:25:45 UTC
I think it has to do with this: http://stackoverflow.com/questions/999066/why-does-php-5-2-disallow-abstract-static-class-methods
Working on it...
Comment 4 Luis Felipe Schenone 2013-05-02 22:37:55 UTC
Well, I submitted a patch to Gerrit (https://gerrit.wikimedia.org/r/#/c/62007/) with an attempt to solve the bug. However, the build went wrong for some reason.
And in any case, after I submitted the patch I realized that the issue I mentioned above (see link to StackOverflow) is not the cause, as it only applies to abstract methods, and not to methods in abstract classes.
So now I have no idea what may be causing the bug.
Comment 5 Luis Felipe Schenone 2013-05-02 23:27:37 UTC
To be a bit more informative:
The parameter 2 of the in_array() on line 2020 comes from the flattenOptions method of the HTMLFormField class. Looking at the code in the method, it seems that it cannot fail to return an array. So I started looking around and I thought, that because the class is abstract, and the method is static, the issue mentioned at http://stackoverflow.com/questions/999066/ may be the cause. So I submitted a patch, but the build failed for some reason, and now I realize that the issue only applies to abstract static methods, and not to static methods in abstract classes.
Comment 6 Gerrit Notification Bot 2013-10-19 11:32:07 UTC
Change 62007 abandoned by Bartosz Dziewoński:
Replaced every HTMLFormField::flattenOptions for $this->flattenOptions

Reason:
Per submitter.

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links