Page MenuHomePhabricator

Parameter must be an array or an object that implements Countable
Closed, ResolvedPublic

Description

Seen on travis on PHP 7.2 https://travis-ci.org/wikimedia/mediawiki/jobs/368430010

  • 30 December 2017: 8x errors for "Parameter must be an array or an object that implements Countable"
  • 18 April 2018: 11x errors for "Parameter must be an array or an object that implements Countable"
  • 9 June 2018: 3x errors for "Parameter must be an array or an object that implements Countable"
1) BitmapMetadataHandlerTest::testMultilingualCascade
count(): Parameter must be an array or an object that implements Countable
/home/travis/build/wikimedia/mediawiki/includes/media/Exif.php:745
/home/travis/build/wikimedia/mediawiki/includes/media/Exif.php:336
/home/travis/build/wikimedia/mediawiki/includes/media/Exif.php:308
/home/travis/build/wikimedia/mediawiki/includes/media/BitmapMetadataHandler.php:92
/home/travis/build/wikimedia/mediawiki/includes/media/BitmapMetadataHandler.php:188
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php:32
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:420
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
2) ExifTest::testGPSExtraction
count(): Parameter must be an array or an object that implements Countable
/home/travis/build/wikimedia/mediawiki/includes/media/Exif.php:745
/home/travis/build/wikimedia/mediawiki/includes/media/Exif.php:336
/home/travis/build/wikimedia/mediawiki/includes/media/Exif.php:308
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/media/ExifTest.php:24
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:420
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
3) ExifTest::testUnicodeUserComment
count(): Parameter must be an array or an object that implements Countable
/home/travis/build/wikimedia/mediawiki/includes/media/Exif.php:745
/home/travis/build/wikimedia/mediawiki/includes/media/Exif.php:336
/home/travis/build/wikimedia/mediawiki/includes/media/Exif.php:308
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/media/ExifTest.php:39
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:420
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 396426 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] ApiQueryBase: Fix addWhereFld for PHP 7.2

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

Change 396426 merged by jenkins-bot:
[mediawiki/core@master] ApiQueryBase: Fix addWhereFld for PHP 7.2

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

Reedy updated the task description. (Show Details)
Reedy updated the task description. (Show Details)

Change 400916 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Only run count() on array()

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

Change 427580 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] API: Fix PHP Warning for "count(): Parameter must be an array"

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

Change 427728 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] userrights: Add array typehints to SpecialUserrights methods

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

Change 427729 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@REL1_31] API: Fix PHP Warning for "count(): Parameter must be an array"

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

Change 427580 merged by jenkins-bot:
[mediawiki/core@master] API: Fix PHP Warning for "count(): Parameter must be an array"

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

Change 427729 merged by jenkins-bot:
[mediawiki/core@REL1_31] API: Fix PHP Warning for "count(): Parameter must be an array"

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

Change 427728 merged by jenkins-bot:
[mediawiki/core@master] userrights: Add array typehints to SpecialUserrights methods

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

Change 441428 had a related patch set uploaded (by Paladox; owner: Krinkle):
[mediawiki/core@REL1_31] userrights: Add array typehints to SpecialUserrights methods

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

Change 441428 abandoned by Paladox:
userrights: Add array typehints to SpecialUserrights methods

Reason:
Hmm i can abandon then and sorry. Also i was backporting this as it may not fix a issue i have seen but seemed to fix other count issues?

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

@Johnywhy: https://phabricator.wikimedia.org/T197893 only lists files in the FlaggedRevs codebase. This task is about code in MediaWiki core. Why should it be related?

Change 443206 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/core@master] Guard against uncountable tag values

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

Change 443206 merged by jenkins-bot:
[mediawiki/core@master] Guard against uncountable tag values

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

Change 448976 had a related patch set uploaded (by Paladox; owner: Samwilson):
[mediawiki/core@REL1_31] Guard against uncountable tag values

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

MaxSem assigned this task to Samwilson.

Change 400916 abandoned by Krinkle:
media: Only run count() on array() in Exif class

Reason:
Superseded by I7ca38bc55ae04f

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

Change 448976 merged by jenkins-bot:
[mediawiki/core@REL1_31] Guard against uncountable tag values

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