Error on PHP 7.2

Started by anunja, 25 March 2019, 14:51:44

Previous topic - Next topic
A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

anunja

Hallo!
I've got an error while running PHP 7.2 with Alexandria Book Library 3.1.4

Warning: count(): Parameter must be an array or an object that implements Countable in /home/users/j/j899766/domains/old-rus.imli.ru/components/com_abook/helpers/icon.php on line 104

When I degrade to 7.1 everything is OK

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

federica

Hi anunja,
when this error occours? Does this error happen when the category does not have a parent category or anyway?

Try to modify components/com_abook/helpers/icon.php line 104
from:
$n=count($category_parent);
to:
$n=is_array($category_parent)?count($category_parent):0;
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]