contao-themes-net / mate-isotope-bundle

Support repository for MATE Isotope Bundle
0 stars 1 forks source link

Warning: count(): Parameter must be an array or an object that implements Countable #3

Closed fritzmg closed 2 years ago

fritzmg commented 2 years ago

If a product happens to have no images, the following error will occur (in dev):

ErrorException:
Warning: count(): Parameter must be an array or an object that implements Countable

  at vendor\contao-themes-net\mate-isotope-bundle\src\Resources\contao\templates\isotope\gallery_slick_vertical.html5:1

This can be fixed by:

-<div class="main-image col s12<?php if(count(unserialize($this->getData()['images'])) > 1): ?> m7 l9 push-m2 push-l3<?php endif; ?>">
+<div class="main-image col s12<?php if(!empty(Contao\StringUtil::deserialize($this->getData()['images'], true))): ?> m7 l9 push-m2 push-l3<?php endif; ?>">

in src\Resources\contao\templates\isotope\gallery_slick_vertical.html5

MDevster commented 2 years ago

@fritzmg Thank you, has been fixed in version 1.2.0.