Page MenuHomePhabricator

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

Description

Setup

  • MediaWiki 1.32.1 (3efaceb) 17:46, 11. Apr. 2019
  • PHP 7.2.15-0ubuntu0.18.04.2 (apache2handler)
  • MariaDB 10.1.38-MariaDB-0ubuntu0.18.04.1
  • Page Schemas 0.4.9 (e3a68ae) 20:50, 17. Jan. 2019

Issue

Warning: count(): Parameter must be an array or an object that implements Countable in /../w/extensions/PageSchemas/includes/PageSchemas.classes.php on line 263

Example
See this page.

Event Timeline

I'm seeing the same error

Warning: count(): Parameter must be an array or an object that implements Countable in .../extensions/PageSchemas/includes/PageSchemas.classes.php on line 235

MediaWiki 1.32.0
PHP 7.2.19 (cgi-fcgi)
MySQL 5.6.44-86.0
PageSchemas 0.4.9

@Yaron_Koren FYI Not sure if you get to see this by default.

@Kghbln - thanks for including me; no, I didn't see this before. I just checked in what I think is a fix for this.

@Yaron_Koren You are welcome. I just checked out master but the issue still persists.

I'm also getting the same error with a new install of 0.4.9
Seems to be when I try and add a section.

Line 263:

if ( count( $returnVals ) != 2 ) {
    continue;
}

Likewise I still see the same.

Yaron_Koren claimed this task.

It looks like that second Countable bug was fixed about a month later:

https://phabricator.wikimedia.org/rEPSC845f5ae98b7bac5adc531dbb1e8612211ab49a98