Keyword

Parameter must be an array

More
7 years 4 months ago #169432 by Boyan Dimov
Replied by Boyan Dimov on topic Parameter must be an array
after update to 2.9.0 still having the same issue, any other suggestions?

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169438 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Where exactly does this issue appear? It's very broad, reminds me of: importblogkit.com/2015/07/does-not-work/

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169451 by Boyan Dimov
Replied by Boyan Dimov on topic Parameter must be an array
Hi Fotis,

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.

More
7 years 4 months ago #169463 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Can you please install v2.9.1 (dev) directly from K2's GitHub repo using: github.com/getk2/k2/archive/master.zip

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.

More
7 years 4 months ago #169485 by Boyan Dimov
Replied by Boyan Dimov on topic Parameter must be an array
Hi Fotis,

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.

More
7 years 4 months ago #169494 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
You'll need to send me back the code in that line exactly.

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169507 by Boyan Dimov
Replied by Boyan Dimov on topic Parameter must be an array
Hi Fotis,

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.

More
7 years 4 months ago #169513 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Update it to this:
<?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.

More
7 years 4 months ago #169574 by Adam
Replied by Adam on topic Parameter must be an array
Hello,
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.

More
7 years 4 months ago #169580 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
I've implemented these checks anywhere we use the count() function in K2's templates. Please install 2.9.1 dev once more: github.com/getk2/k2/archive/master.zip

Let me know if you're OK.

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169585 by Adam
Replied by Adam on topic Parameter must be an array
It worked, thank you!

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169586 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Great!

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169594 by Boyan Dimov
Replied by Boyan Dimov on topic Parameter must be an array

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.

More
7 years 4 months ago #169595 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Boyan, I recommend you install K2 2.9.1 dev from github.com/getk2/k2/archive/master.zip as this and other parts of the code in the templates is now fixed.

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169618 by Uzi
Replied by Uzi on topic Parameter must be an array
I still have this issue in the mod_k2_content on line 62. There is still a count function.

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169651 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
We'll fix it on the coming update. In the meantime, you can simply hide warnings/notices.

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169652 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #169673 by Ralf
Replied by Ralf on topic Parameter must be an array
Hi Fotis,
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.

More
7 years 4 months ago #169690 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Noted.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago - 7 years 2 months ago #170570 by burnyourears
Replied by burnyourears on topic Parameter must be an array
I get this error on opening a new article:

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? :-)
Last edit: 7 years 2 months ago by burnyourears.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum