Page 1 of 2
COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 01 Jun 2023, 15:30
by kleini78
Hi
When i publish/unpublish a entry in the guestbook, there's a error on my new updated Joomla site.
COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Call stack
# Function Location
1 () JROOT/components/com_phocaguestbook/controllers/phocaguestbook.php:549
2 PhocaguestbookControllerPhocaguestbook->changeState() JROOT/components/com_phocaguestbook/controllers/phocaguestbook.php:520
3 PhocaguestbookControllerPhocaguestbook->unpublish() JROOT/libraries/src/MVC/Controller/BaseController.php:678
4 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/components/com_phocaguestbook/phocaguestbook.php:20
5 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
6 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
7 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
8 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208
9 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249
10 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
11 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61
12 require_once() JROOT/index.php:32
I've updated the site from Joomla 3.10.11 to 4.3.2 and after that i've installed phoca guestbook on Joomla 4.3.2.
Joomla 4.3.2
PHP: 8.0.28
MySQL 5.7.39-0ubuntu0.18.04.2
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 01 Jun 2023, 23:20
by Jan
Hi,
please try to open this file:
components/com_phocaguestbook/controllers/phocaguestbook.php on line 549
and change FROM:
TO:
and save. Did this change help?
Jan
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 02 Jun 2023, 10:03
by kleini78
Thank you for your help. This error is now solved. Now i've got the next one:
CALL TO UNDEFINED METHOD JOOMLA\DATABASE\MYSQLI\MYSQLIDRIVER::QUERY()
all stack
# Function Location
1 () JROOT/components/com_phocaguestbook/models/guestbook.php:577
2 PhocaguestbookModelGuestbook->publish() JROOT/components/com_phocaguestbook/controllers/phocaguestbook.php:554
3 PhocaguestbookControllerPhocaguestbook->changeState() JROOT/components/com_phocaguestbook/controllers/phocaguestbook.php:520
4 PhocaguestbookControllerPhocaguestbook->unpublish() JROOT/libraries/src/MVC/Controller/BaseController.php:678
5 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/components/com_phocaguestbook/phocaguestbook.php:20
6 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
7 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
8 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
9 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208
10 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249
11 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
12 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61
13 require_once() JROOT/index.php:32
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 06 Jun 2023, 00:29
by Jan
Hi, thank you for the info, can you try to edit the code on line 577 ( components/com_phocaguestbook/models/guestbook.php )
FROM:
TO:
and let me know if this is OK?
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 06 Jun 2023, 10:13
by kleini78
Hi
Thanks for your help. Now it works great.
I've also changed the line 556 (components/com_phocaguestbook/models/guestbook.php )
and line 499 ( components/com_phocaguestbook/models/guestbook.php ) to
(for delete an entry)
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 06 Jun 2023, 22:57
by Jan
Hi, thank you for the info, will be changed in next version.
Thank you, Jan
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 30 Jun 2023, 08:10
by kleini78
Sorry. I've seen, there is an error in my last post. Here is the full description:
components/com_phocaguestbook/controllers/phocaguestbook.php on line 499
To:
components/com_phocaguestbook/controllers/phocaguestbook.php on line 549
To:
components/com_phocaguestbook/models/guestbook.php on line 577
To:
components/com_phocaguestbook/models/guestbook.php on line 577
To:
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 30 Jun 2023, 12:16
by christine
Hi,
Thanks for the infos & correction.
We noticed this in another thread.
The wrong file was this:
... and line 499 ( components/com_phocaguestbook/models/guestbook.php ) to .....
instead of: components/com_phocaguestbook/controllers/phocaguestbook.php
Kind regards
Christine
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 25 Jul 2023, 17:20
by Jan
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Posted: 29 Aug 2023, 07:22
by kleini78
No. The same issue in 4.0.3. But on other line
Call to undefined method Joomla\Database\Mysqli\MysqliDriver::query()
Call stack
# Function Location
1 () JROOT/components/com_phocaguestbook/models/guestbook.php:605
2 PhocaguestbookModelGuestbook->checkReference() JROOT/components/com_phocaguestbook/models/guestbook.php:103
3 PhocaguestbookModelGuestbook->store() JROOT/components/com_phocaguestbook/controllers/phocaguestbook.php:451
4 PhocaguestbookControllerPhocaguestbook->submit() JROOT/libraries/src/MVC/Controller/BaseController.php:678
5 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/components/com_phocaguestbook/phocaguestbook.php:20
6 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
7 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
8 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
9 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208
10 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249
11 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
12 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61
13 require_once() JROOT/index.php:32
To solve:
components/com_phocaguestbook/models/guestbook.php on line 605
From
To: