?
avatar toivo
toivo
26 Nov 2018

Steps to reproduce the issue

  1. Install Weblinks 3.6.0 Package from https://extensions.joomla.org/extensions/extension/official-extensions/weblinks/ on Joomla 3.9.0 using PHP 7.2 and set to report PHP warnings.
  2. Go to Components - Web Links and add any URL as New Web Link to the existing category Uncategorised with default options, Save & Close.
  3. Create a new menu item and select Web Links - List All Web Link Categories with default options, Save & Close.
  4. Go to the front end and select the new link.

Expected result

The list shows the category Uncategorised.

Actual result

Warning: count(): Parameter must be an array or an object that implements Countable in C:\www\joomla380\components\com_weblinks\models\categories.php on line 95

The list shows the category Uncategorised.

System information (as much as possible)

Joomla 3.9.0
PHP 7.2.11

Additional comments

Fixed by inserting the following lines before line 95 in
components/com_weblinks/models/categories.php

	if (!is_array($this->_items))
	{
		$this->_items	= array();
	}

Ref. topic "Weblinks Categories page - Warning: count() at https://forum.joomla.org/viewtopic.php?f=715&t=967481

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar toivo toivo - open - 26 Nov 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Nov 2018
avatar SharkyKZ
SharkyKZ - comment - 26 Nov 2018

Please open this issue at https://github.com/joomla-extensions/weblinks/issues as Weblinks is a decoupled extension.

avatar infograf768
infograf768 - comment - 26 Nov 2018

Also, I can't reproduce your issue here on 3.9.1-rc
I always get 2 arrays, even if the first one if NULL

avatar toivo
toivo - comment - 26 Nov 2018

I do not know about 3.9.1-rc but I have now reproduced the warning in an out-of-the-box Joomla 3.9.0 updated with Joomla_3.9.1-dev-Development-Update_Package.zip.

Also in the code available from https://github.com/joomla-extensions/weblinks the file models/categories.php is identical to version 3.6.0.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23172.
avatar toivo
toivo - comment - 26 Nov 2018

In any case, submitted joomla-extensions/weblinks#393


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23172.

avatar joomla-cms-bot joomla-cms-bot - change - 26 Nov 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-11-26 15:33:06
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 26 Nov 2018
avatar Quy Quy - change - 26 Nov 2018
Closed_Date 2018-11-26 15:33:06 2018-11-26 15:33:07
Closed_By joomla-cms-bot Quy
avatar joomla-cms-bot
joomla-cms-bot - comment - 26 Nov 2018

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/23172

Add a Comment

Login with GitHub to post a comment