Page MenuHomePhabricator

PHP Warning: count(): Parameter must be an array or an object that implements Countable
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Request URL: https://en.wikipedia.org/w/?title=Special:Book&bookcmd=suggest
Request ID: XSGvWApAMFsAADX6ek0AAAAX

message
[XSGvWApAMFsAADX6ek0AAAAX] /w/index.php?title=Special:Book&bookcmd=suggest   ErrorException from line 134 of /srv/mediawiki/php-1.34.0-wmf.11/extensions/Collection/includes/CollectionProposals.php: PHP Warning: count(): Parameter must be an array or an object that implements Countable
trace
#0 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Collection/includes/CollectionProposals.php(134): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Collection/includes/CollectionProposals.php(126): CollectionProposals->addCollectionArticles()
#2 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Collection/includes/CollectionProposals.php(106): CollectionProposals->updateLinkList()
#3 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Collection/includes/CollectionSuggest.php(198): CollectionProposals->getProposals(integer)
#4 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Collection/includes/CollectionSuggest.php(53): CollectionSuggest::getCollectionSuggestTemplate(string, string)
#5 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Collection/includes/Specials/SpecialCollection.php(334): CollectionSuggest::run()
#6 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Collection/includes/Specials/SpecialCollection.php(295): SpecialCollection->processSuggestCommand()
#7 /srv/mediawiki/php-1.34.0-wmf.11/includes/specialpage/SpecialPage.php(571): SpecialCollection->execute(NULL)
#8 /srv/mediawiki/php-1.34.0-wmf.11/includes/specialpage/SpecialPageFactory.php(581): SpecialPage->run(NULL)
#9 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#10 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(884): MediaWiki->performRequest()
#11 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(515): MediaWiki->main()
#12 /srv/mediawiki/php-1.34.0-wmf.11/index.php(42): MediaWiki->run()
#13 /srv/mediawiki/w/index.php(3): require(string)
#14 {main}

Impact

Unknown.

Notes

Seen thrice in the last 24 hours, and 16 times in the last 7 days.

Event Timeline

		$numItems = count( $this->mColl['items'] );

probably wants to become

		$numItems = isset( $this->mColl['items'] ) ? count( $this->mColl['items'] ) : 0;

and then just let it bail out on the check after

		if ( $numItems === 0 || $numItems > $wgCollectionSuggestThreshhold ) {
			return;
		}

Change 521039 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/Collection@master] CollectionProposals.php: Fix count(): Parameter must be an array or an object that implements Countable

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

Change 521775 had a related patch set uploaded (by Krinkle; owner: Reedy):
[mediawiki/extensions/Collection@wmf/1.34.0-wmf.13] CollectionProposals.php: Fix count(): Parameter must be an array or an object that implements Countable

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

Change 521039 merged by jenkins-bot:
[mediawiki/extensions/Collection@master] CollectionProposals.php: Fix count(): Parameter must be an array or an object that implements Countable

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

Change 521775 merged by jenkins-bot:
[mediawiki/extensions/Collection@wmf/1.34.0-wmf.13] CollectionProposals.php: Fix count(): Parameter must be an array or an object that implements Countable

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

Krinkle assigned this task to Reedy.
Krinkle removed a project: Patch-For-Review.

Mentioned in SAL (#wikimedia-operations) [2019-07-09T22:09:49Z] <krinkle@deploy1001> Synchronized php-1.34.0-wmf.13/extensions/Collection/includes/CollectionProposals.php: T227407 / rECOL69a30966ce80 (duration: 00m 57s)

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:05 PM