- Posts: 2
COMMUNITY FORUM
Parameter must be an array
- Adam
-
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Boyan Dimov
-
- Offline
- New Member
- Posts: 9
Fotis wrote: Update it to this:
<?php if($params->get('itemExtraFields') && isset($this->item->extra_fields) && count($this->item->extra_fields)): ?>
Also worked.
Thank you for the support :)
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Uzi
-
- Offline
- Premium Member
- Posts: 140
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Ralf
-
- Offline
- New Member
- Posts: 17
got the same Warning in two other lines:
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /www/htdocs/administrator/components/com_k2/models/item.php on line 412
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /www/htdocs/administrator/components/com_k2/models/item.php on line 687
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- burnyourears
-
- Offline
- Senior Member
- Posts: 66
Warning: sizeof(): Parameter must be an array or an object that implements Countable in administrator/components/com_k2/views/item/view.html.php on line 338
It addresses the extra field section of the view.html.php:
// Extra fields
$extraFieldModel = K2Model::getInstance('ExtraField', 'K2Model');
if ($category->id) {
$extraFields = $extraFieldModel->getExtraFieldsByGroup($category->extraFieldsGroup);
} else {
$extraFields = null;
}
for ($i = 0; $i < sizeof($extraFields); $i++) {
$extraFields[$i]->element = $extraFieldModel->renderExtraField($extraFields[$i], $item->id);
}
Line 338 is:
for ($i = 0; $i < sizeof($extraFields); $i++) {
Any idea? :-)
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- burnyourears
-
- Offline
- Senior Member
- Posts: 66
Warning: count(): Parameter must be an array or an object that implements Countable in /components/com_k2/models/item.php on line 1233
... Could you tell me how to disable these warnings? The last one mentioned is also live ... > www.burnyourears.de/reviews/buecher-und-spiele.html
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- burnyourears
-
- Offline
- Senior Member
- Posts: 66
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Daniel Pardons
-
- Offline
- New Member
- Posts: 2
After installing current github version 2.9.1, I found the error on displaying K2 single item
( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in C:\wamp64\www\jd_miami\templates\jd_miami\html\com_k2\templates\default\item.php on line 291
Call Stack
# Time Memory Function Location
1 0.0004 406176 {main}( ) ...\index.php:0
2 0.0622 1426664 Joomla\CMS\Application\SiteApplication->execute( ) ...\index.php:49
3 0.0622 1426664 Joomla\CMS\Application\SiteApplication->doExecute( ) ...\CMSApplication.php:196
4 0.3818 3456584 Joomla\CMS\Application\SiteApplication->dispatch( ) ...\SiteApplication.php:233
5 0.3824 3480440 Joomla\CMS\Component\ComponentHelper::renderComponent( ) ...\SiteApplication.php:194
6 0.3834 3599832 Joomla\CMS\Component\ComponentHelper::executeComponent( ) ...\ComponentHelper.php:377
7 0.3835 3616888 require_once( 'C:\wamp64\www\jd_miami\components\com_k2\k2.php' ) ...\ComponentHelper.php:402
8 0.3942 3762208 K2ControllerItem->execute( ) ...\k2.php:64
9 0.3942 3762208 K2ControllerItem->display( ) ...\BaseController.php:710
10 0.4056 3907712 K2ControllerItem->display( ) ...\item.php:74
11 0.4056 3907712 K2ControllerItem->display( ) ...\controller.php:19
12 0.4064 3915616 K2ViewItem->display( ) ...\BaseController.php:672
13 0.5852 4798120 K2ViewItem->display( ) ...\view.html.php:521
14 0.5852 4798120 K2ViewItem->loadTemplate( ) ...\HtmlView.php:230
15 0.5864 4823840 include( 'C:\wamp64\www\jd_miami\templates\jd_miami\html\com_k2\templates\default\item.php' ) ...\HtmlView.php:697
As the line 291 and 292 are:
<!-- Plugins: AfterDisplayContent -->
<?php echo $this->item->event->AfterDisplayContent; ?>
I am stuck.
Could you investigate this problem?
Regards
Daniel
Please Log in or Create an account to join the conversation.
- Daniel Pardons
-
- Offline
- New Member
- Posts: 2
Sorry but after investigation, the here above problem is due to the item.php override of the jd_miami template. I will report the problem to joomdev.
Thanks for K2 component.
Regards
Daniel
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- daga
-
- Offline
- New Member
- Posts: 1
My solution:
1. Create Extra Field Group - e.g. Class
2. Add Extra field e.g. "test" to group Class (set as not required)
3. Assign a Class group to each K2 category
4. Add each article to the category. If you have an existing file with warning, you must save it again.
I hope it will help :)
Regards
Please Log in or Create an account to join the conversation.
- Eugene
-
- Offline
- New Member
- Posts: 1
Warning: count(): Parameter must be an array or an object that implements Countable in /home/xxx/public_html/site/templates/xxx/html/com_k2/blog-2columns/item.php on line 105
Please Log in or Create an account to join the conversation.