Page MenuHomePhabricator

SpecialPagesWithProp PHP notice with empty/nonexistent props
Closed, ResolvedPublic

Description

Special:PageWithProps outputs the following PHP notices if a specific page prop either does not exist or otherwise has no values in the database:

The cause is because $propnames is declared implicitly using PHP's magical functionality with non-existent arrays.

Notice: Undefined variable: propnames in /vagrant/mediawiki/includes/specials/SpecialPagesWithProp.php on line 65

Call Stack:

0.0002     640016   1. {main}() /vagrant/mediawiki/index.php:0
0.1494    3588856   2. MediaWiki->run() /vagrant/mediawiki/index.php:55
0.1496    3588856   3. MediaWiki->main() /vagrant/mediawiki/includes/Wiki.php:458
0.1542    3701776   4. MediaWiki->performRequest() /vagrant/mediawiki/includes/Wiki.php:565
0.2257    4650336   5. SpecialPageFactory::executePath() /vagrant/mediawiki/includes/Wiki.php:291
0.2302    5370152   6. SpecialPage->run() /vagrant/mediawiki/includes/SpecialPageFactory.php:487
0.2304    5370152   7. SpecialPagesWithProp->execute() /vagrant/mediawiki/includes/SpecialPage.php:631

Warning: in_array() expects parameter 2 to be array, null given in /vagrant/mediawiki/includes/HTMLForm.php on line 2150

Call Stack:

0.0002     640016   1. {main}() /vagrant/mediawiki/index.php:0
0.1494    3588856   2. MediaWiki->run() /vagrant/mediawiki/index.php:55
0.1496    3588856   3. MediaWiki->main() /vagrant/mediawiki/includes/Wiki.php:458
0.1542    3701776   4. MediaWiki->performRequest() /vagrant/mediawiki/includes/Wiki.php:565
0.2257    4650336   5. SpecialPageFactory::executePath() /vagrant/mediawiki/includes/Wiki.php:291
0.2302    5370152   6. SpecialPage->run() /vagrant/mediawiki/includes/SpecialPageFactory.php:487
0.2304    5370152   7. SpecialPagesWithProp->execute() /vagrant/mediawiki/includes/SpecialPage.php:631
0.3493    7655352   8. HTMLForm->__construct() /vagrant/mediawiki/includes/specials/SpecialPagesWithProp.php:70
0.3493    7656912   9. HTMLForm::loadInputFromParameters() /vagrant/mediawiki/includes/HTMLForm.php:225
0.3493    7660064  10. HTMLSelectOrOtherField->__construct() /vagrant/mediawiki/includes/HTMLForm.php:311
0.3493    7660440  11. in_array() /vagrant/mediawiki/includes/HTMLForm.php:2150

Version: 1.22.0
Severity: normal

Details

Reference
bz51891

Event Timeline

bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz51891.

Change 76061 had a related patch set uploaded by IAlex:
Fix PHP notice in Special:PagesWithProp where there are no page properties in the database

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

Change 76061 had a related patch set uploaded by Matmarex:
Fix PHP notice in Special:PagesWithProp where there are no page properties in the database

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

Change 76061 merged by jenkins-bot:
Special:PagesWithProp: Fix PHP notice if no page properties are present

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