extras-evolution / multiTV

Custom TV for Evolution CMS: Transform a template variables into a sortable multi item list for the Evolution content management framework
8 stars 23 forks source link

PHP7.2 count() issue #47

Closed scenduk closed 5 years ago

scenduk commented 5 years ago

We're using Evo 1.4.6. Our host just upgraded to PHP7.2 and it triggered the error below when the multiTV variable is empty, when there are fields then it only outputs the first one.

Trying to get property 'action' of non-object « Evo Parse Error » Error : count(): Parameter must be an array or an object that implements Countable File /httpd.www/assets/tvs/multitv/includes/multitv.class.php Line 1089 Source $countOutput = count($tvOutput); Current Snippet multiTV

Dmi3yy commented 5 years ago

Will fix tomorow.

Отправлено с iPhone

13 нояб. 2018 г., в 16:14, Tom Adams notifications@github.com написал(а):

We're using Evo 1.4.6. Our host just upgraded to PHP7.2 and it triggered the error below when the multiTV variable is empty, when there are fields then it only outputs the first one.

Trying to get property 'action' of non-object « Evo Parse Error » Error : count(): Parameter must be an array or an object that implements Countable File /httpd.www/assets/tvs/multitv/includes/multitv.class.php Line 1089 Source $countOutput = count($tvOutput); Current Snippet multiTV

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Dmi3yy commented 5 years ago

Need add check for array before count

Отправлено с iPhone

13 нояб. 2018 г., в 16:14, Tom Adams notifications@github.com написал(а):

We're using Evo 1.4.6. Our host just upgraded to PHP7.2 and it triggered the error below when the multiTV variable is empty, when there are fields then it only outputs the first one.

Trying to get property 'action' of non-object « Evo Parse Error » Error : count(): Parameter must be an array or an object that implements Countable File /httpd.www/assets/tvs/multitv/includes/multitv.class.php Line 1089 Source $countOutput = count($tvOutput); Current Snippet multiTV

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

scenduk commented 5 years ago

To resolve the error for now I changed line 1089 to: $countOutput = is_array($tvOutput) && count($tvOutput);

But I don't know if that's the best way or not... it still only outputs the first result, I'm not sure how to resolve that.

Dmi3yy commented 5 years ago

can you check now

on my site work with:

scenduk commented 5 years ago

Works perfectly now, thanks!