Keyword

Advanced Search

Search Results (Searched for: countable error)

  • trogladyte
  • trogladyte's Avatar
04 Sep 2019 19:36
Replied by trogladyte on topic Parameter must be an array

Parameter must be an array

Category: English K2 Community

I just upgraded my server from PHP7.1.31 to PHP7.3.x yesterday as I was getting EOL warnings from Joomla. Since that, I can confirm that this K2 warning has now appeared,

Warning: count(): Parameter must be an array or an object that implements Countable in /home/tastewas/public_html/components/com_k2/models/item.php on line 763

While I understand that it's only a warning and only appears if the error reporting in Joomla is set to anything other than none or Sys Def, and it doesn't affect site operation, does this not mean that the K2 code isn't completely in line with current PHP versions?
  • JoomlaWorks
  • JoomlaWorks's Avatar
22 Apr 2019 21:11
Replied by JoomlaWorks on topic Multiple issues after upgrade to Joomla 3.9.5

Multiple issues after upgrade to Joomla 3.9.5

Category: English K2 Community

Install K2 v2.9.1 (dev) on top of 2.9.0 from: github.com/getk2/k2/archive/master.zip

This should resolve the countable() warnings in PHP 7.2+.

The error "Using $this when not in object context" which probably causes a fatal error in the frontend may come from a 3rd party extension that utilizes K2 content.

A URL to your site(s) would also help.
  • Eugene
  • Eugene's Avatar
13 Feb 2019 07:55
Replied by Eugene on topic Parameter must be an array

Parameter must be an array

Category: English K2 Community

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
  • Mo
  • Mo's Avatar
28 Jan 2019 13:03

Multiple K2 errors after upgrade to PHP 7.3.0

Category: English K2 Community

Hi,

I'm getting multiple K2 errors since upgrading to php 7.3.0 across various plug ins and component pages:

Warning: count(): Parameter must be an array or an object that implements Countable in \components\com_k2\models\item.php on line 763
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in \modules\mod_k2_user\helper.php on line 104
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in \modules\mod_k2_user\helper.php on line 132
  • Igor
  • Igor's Avatar
22 Jan 2019 17:24

Error after upgrade PHP to version 7.2

Category: English K2 Community

Hello,
after upgrade PHP to 7.2 I receive this error message when open all article:
Warning: count(): Parameter must be an array or an object that implements Countable in /home/editfi5/public_html/editnews/components/com_k2/models/item.php on line 763

Before and after article like here:
editfiume.info/editnews/politica/3632-il-fronte-dei-lavoratori-punta-in-alto

What I can do?
  • Brigitte Kuschel
  • Brigitte Kuschel's Avatar
13 Jan 2019 15:15
error with extra fields v2.9 php 7.2 was created by Brigitte Kuschel

error with extra fields v2.9 php 7.2

Category: English K2 Community

Hello,

i love the extra fields of k2.

i upgrade to joomla 3.9.1 and newest version k2 v2.9 no problem at all.
i installed the newest simple image gallery pro too.

but set server to php 7.2 i have an error with it (it works fine on php 7.1.)

Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/www/nbm/administrator/components/com_k2/views/item/view.html.php on line 442

and at the extra file tab

Warning: count(): Parameter must be an array or an object that implements Countable in /home/www/nbm/administrator/components/com_k2/models/extrafield.php on line 211


The error ist only at new items. At old items, there is no error.

at frontend there is no error

Can somebody please help me?

THank you very much.

Brigitte

  • Daniel Pardons
  • Daniel Pardons's Avatar
01 Jan 2019 16:08
Replied by Daniel Pardons on topic Parameter must be an array

Parameter must be an array

Category: English K2 Community

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
  • burnyourears
  • burnyourears's Avatar
11 Dec 2018 14:32 - 11 Dec 2018 14:33
Replied by burnyourears on topic Parameter must be an array

Parameter must be an array

Category: English K2 Community

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? :-)
  • JoomlaWorks
  • JoomlaWorks's Avatar
27 Sep 2018 17:09
Replied by JoomlaWorks on topic Error after K2 2.9.0 upgrade

Error after K2 2.9.0 upgrade

Category: English K2 Community

We don't implement that class ("Countable") in our code. It probably comes from a 3rd party extension that integrates/extends K2 content. Look at your Plugin Manager first.
  • Helmut
  • Helmut's Avatar
26 Sep 2018 13:23
Error after K2 2.9.0 upgrade was created by Helmut

Error after K2 2.9.0 upgrade

Category: English K2 Community

Hi,

after upgrading to the newest K2 version every article starts with:
Warning: count(): Parameter must be an array or an object that implements Countable in /home/.sites/43/site4952321/web/components/com_k2/models/item.php on line 76

and ends with:
Warning: count(): Parameter must be an array or an object that implements Countable in /home/.sites/43/site4952321/web/components/com_k2/templates/default/item.php on line 248

Joomla 3.8.12
MySQLi 5.5.59
PHP 7.2.10

Any ideas? - Thanks
  • Michael Mc
  • Michael Mc's Avatar
16 Feb 2018 22:13
Parameter must be an array was created by Michael Mc

Parameter must be an array

Category: English K2 Community

Hello there,

So I have a fresh install Joomla Version 3.8.5
Just installed K2 and started to set stuff up.

Whenever Joomla brings up a K2 Article Page I receive the 2 error messages: The first one (1) is on top of the screen before the title, the second message (2) before Read xx times.

1) Warning: count(): Parameter must be an array or an object that implements Countable in E:\xampp\htdocs\Joomla\components\com_k2\models\item.php on line 877

2) Warning: count(): Parameter must be an array or an object that implements Countable in E:\xampp\htdocs\Joomla\components\com_k2\templates\default\item.php on line 248

I receive no other error message anywhere on the site. Everything else is normal. I went through the count options on the category screen and turn off anything that was counting related. Still no go.


PHP Version 7.2.1
Web Server Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.1
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.8.5 Stable [ Amani ] 6-February-2018 15:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

Thanks in advance!
Displaying 21 - 31 out of 31 results.

Powered by Kunena Forum