Keyword

Parameter must be an array

More
6 years 6 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
6 years 6 months ago #169586 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Great!

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 6 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
6 years 6 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.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 6 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
6 years 6 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.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

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

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 6 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
6 years 6 months ago #169690 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Noted.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 4 months ago - 6 years 4 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: 6 years 4 months ago by burnyourears.

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

More
6 years 4 months ago #170571 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
First off, it's a warning, not an error. Probably because you're in PHP 7.2. Secondly, most of these issues have been resolved in K2 v2.9.1 (dev) which you can install on top of 2.9.0 from here: github.com/getk2/k2/archive/master.zip

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 4 months ago #170573 by burnyourears
Replied by burnyourears on topic Parameter must be an array
Yep, I know. And I even installed the dev-version... the warning is still there. Here's another:

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.

More
6 years 4 months ago #170574 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Simply set error reporting to none or default in Joomla. And I've noted down to fix them in the K2 repo.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 4 months ago #170576 by burnyourears
Replied by burnyourears on topic Parameter must be an array
Ah ... thank you!

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

More
6 years 4 months ago #170578 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
You're welcome.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 3 months ago #170723 by Daniel Pardons
Replied by Daniel Pardons on topic Parameter must be an array
Hi
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.

More
6 years 3 months ago #170726 by Daniel Pardons
Replied by Daniel Pardons on topic Parameter must be an array
Hi
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.

More
6 years 3 months ago #170752 by JoomlaWorks
Replied by JoomlaWorks on topic Parameter must be an array
Great!

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 3 months ago #170855 by daga
Replied by daga on topic Parameter must be an array
Hi, I have Joomla 3.9.1 + K2 (2.9.0) + PHP 7.2.
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.

More
6 years 2 months ago #171185 by Eugene
Replied by Eugene on topic Parameter must be an array
Have applied the latest 2.9.1 dev, still got the following error

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.


Powered by Kunena Forum