Parameter must be an array or an object that implements Countable
Open, Needs TriagePublic

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
Reedy created this task.Dec 8 2017, 2:50 AM
Restricted Application added projects: Commons, Multimedia. · View Herald TranscriptDec 8 2017, 2:50 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Reedy moved this task from Unsorted to PHP 7.2 on the [DO NOT USE] NewPHP board.Dec 8 2017, 2:56 AM

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

Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.Dec 8 2017, 4:52 PM
Anomie moved this task from Needs Review to Done on the MediaWiki-API board.Dec 8 2017, 5:48 PM

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)Dec 30 2017, 2:08 AM
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

Krinkle updated the task description. (Show Details)Apr 19 2018, 1:36 AM

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

Reedy updated the task description. (Show Details)Jun 9 2018, 2:30 AM

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