- Posts: 9
COMMUNITY FORUM
Parameter must be an array
- Boyan Dimov
-
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
Please Log in or Create an account to join the conversation.
- Boyan Dimov
-
- Offline
- New Member
- Posts: 9
The link you provided it's not available.
Here is a link on one of my websites which give me this problem:
careers.mosconsultbg.com
If you navigate to History/Benefits/Culture/Internship menus you will see the error in the top and bottom of the page
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
It should fix the first warning I see on: careers.mosconsultbg.com/en/history-en
For the second warning, you'll need to paste back the code at the line mentioned from that file in your Joomla template (a K2 override).
Please Log in or Create an account to join the conversation.
- Boyan Dimov
-
- Offline
- New Member
- Posts: 9
I already installed 2.9.1 and it already fixed the first problem. Thanks for it.
But I misunderstood you about the second one - which code shall I paste in K2 Override?
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
Please Log in or Create an account to join the conversation.
- Boyan Dimov
-
- Offline
- New Member
- Posts: 9
Here is the code on line 131:
/templates/gk_msocial/html/com_k2/templates/default/item.php
<?php if($params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
<?php if($params->get('itemExtraFields') && isset($this->item->extra_fields) && count($this->item->extra_fields)): ?>Please Log in or Create an account to join the conversation.
- Adam
-
- Offline
- New Member
- Posts: 2
I also have 2.9.1 installed and the second I probably need a code, right?
Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/web25494274/html/twingo/components/com_k2/templates/default/category_item.php on line 134
Thanks in advance!
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
Let me know if you're OK.
Please Log in or Create an account to join the conversation.
- Adam
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
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: 6229
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: 6229
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
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 687Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
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.