COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
-
- Phoca Newbie
- Posts: 5
- Joined: 01 Jun 2023, 15:02
COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
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
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
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
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
please try to open this file:
components/com_phocaguestbook/controllers/phocaguestbook.php on line 549
and change FROM:
Code: Select all
if (count( $entryid ) < 1) {
Code: Select all
if ((int)$entryid < 1) {
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 01 Jun 2023, 15:02
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
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
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
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
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?
FROM:
Code: Select all
if (!$this->_db->query()) {
Code: Select all
if (!$this->_db->execute()) {
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 01 Jun 2023, 15:02
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
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)
Thanks for your help. Now it works great.
I've also changed the line 556 (components/com_phocaguestbook/models/guestbook.php )
Code: Select all
if(!$this->_db->execute()) {
Code: Select all
if ((Int)$cid < 1) {
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
Hi, thank you for the info, will be changed in next version.
Thank you, Jan
Thank you, Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 01 Jun 2023, 15:02
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
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:
components/com_phocaguestbook/controllers/phocaguestbook.php on line 499
Code: Select all
if (count( $cid ) < 1) {
Code: Select all
if ((int)$cid < 1) {
components/com_phocaguestbook/controllers/phocaguestbook.php on line 549
Code: Select all
if (count( $entryid ) < 1) {
Code: Select all
if ((int)$entryid < 1) {
components/com_phocaguestbook/models/guestbook.php on line 577
Code: Select all
if (!$this->_db->query()) {
Code: Select all
if (!$this->_db->execute()) {
components/com_phocaguestbook/models/guestbook.php on line 577
Code: Select all
if (!$this->_db->query()) {
Code: Select all
if(!$this->_db->execute()) {
-
- Phoca Hero
- Posts: 2819
- Joined: 28 Nov 2010, 17:20
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
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
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
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 01 Jun 2023, 15:02
Re: COUNT(): ARGUMENT #1 ($VALUE) MUST BE OF TYPE COUNTABLE|ARRAY, INT GIV
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:
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
Code: Select all
if (!$this->_db->query()) {
Code: Select all
if (!$this->_db->execute()) {