Vox Populi(x) forum

Alexandria Book Library => Errori (Bugs) => Topic started by: anunja on 24 May 2024, 15:17:02

Title: Error when making category for registered
Post by: anunja on 24 May 2024, 15:17:02
Hello, friends!
I need to hide my Abook content from public. But when i set access "registered" for the category i see 'Page not found' and error 'sizeof(): Argument #1 ($value) must be of type Countable|array, bool given'. What shoul l do? Please help!
PHP 8.2, joomla 5.1.0
Title: Re: Error when making category for registered
Post by: federica on 26 May 2024, 21:33:31
Hi anunja,
which Abook version are you using?
Title: Re: Error when making category for registered
Post by: anunja on 27 May 2024, 09:35:56
Hello!
Joomla 5.1.0
Alexandria Book Library 4.0.2
Title: Re: Error when making category for registered
Post by: federica on 27 May 2024, 10:27:32
You are right!
To fix them you can modify your_site/components/com_abook/models/category.php line 390
from
if (sizeof($this->_children)) {to
if ($this->_children) {
After the change the error displayed will be "404 Category non found".

I will publish the fix to the next version of Abook.

In case of access to unauthorized content, perhaps it would be better to show the login form. I put this change on the todo list.
Title: Re: Error when making category for registered
Post by: anunja on 27 May 2024, 14:44:09
Grazie Federica! Io ho fatto la pagina con la forma di autorizzazione e con il link alla Alexandria category.