Author Topic: Error on PHP 7.2  (Read 104 times)

Offline anunja

  • Coccinella
  • *
  • Posts: 7
  • Karma: +0/-0
Error on PHP 7.2
« on: 25 March 2019, 14:51:44 »
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

Offline federica

  • Amministratore
  • Delfino
  • *****
  • Posts: 1.006
  • Karma: +1/-0
Re: Error on PHP 7.2
« Reply #1 on: 05 April 2019, 10:31:02 »
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.
http://www.antivirushelp.it
stacca la spina!