Forum

Thread tagged as: Error, Field-Types

Field types: Parameter must be an array or an object that implements Countable

In Perch 3.1.2 on PHP 7.2.7 I'm getting warnings in the admin relating to Countable when using some field type addons. I have blocks with template includes. I'm not sure if that makes a difference.

With the Vimeo field type I'm getting:

Warning: count(): Parameter must be an array or an object that implements Countable in /Users/tim/Sites/biner-beasisoftware-com/build/admin/core/lib/PerchFieldTypes.class.php on line 58

Changing line 58 in PerchFieldTypes.class.php from:

if (count($all_tags)) $r->set_sibling_tags($all_tags);

to

if (PerchUtil::count($all_tags)) $r->set_sibling_tags($all_tags);

Might fix it...?

Tim Kinali

Tim Kinali 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that's the fix. We'd addressed this in a previous update but missed that case when loading add-ons.

Great. Then I’ll apply the fix temporarily until it’s addressed in a later update.