?
avatar HLeithner
HLeithner
23 Jul 2016

Steps to reproduce the issue

Open Content -> Categories in Administrator

Expected result

No Warning

Actual result

The following Warning get displayed with PHP 7.0 but not with PHP 5.6

^^^Warning: Parameter 1 to ContentHelper::countItems() expected to be a reference, value given in /administrator/components/com_categories/models/categories.php on line 395^^^

Votes

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

avatar HLeithner HLeithner - open - 23 Jul 2016
avatar brianteeman
brianteeman - comment - 23 Jul 2016

What version of joomla?

Do you have any extensions installed?

I do not see this problem

On 23 July 2016 at 17:11, Harald notifications@github.com wrote:

Steps to reproduce the issue

Open Content -> Categories in Administrator
Expected result

No Warning
Actual result

The following Warning get displayed with PHP 7.0 but not with PHP 5.6

^^^Warning: Parameter 1 to ContentHelper::countItems() expected to be a
reference, value given in
/administrator/components/com_categories/models/categories.php on line
395^^^


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#11274, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8R9H4E5LCDBP8GNRinqgDBawXR7Cks5qYi8zgaJpZM4JTYEY
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar nikiedev
nikiedev - comment - 26 Jul 2016

The same problem! Need solution, please.

avatar brianteeman
brianteeman - comment - 26 Jul 2016

Same question as I asked before

What version of joomla?

Do you have any extensions installed?

avatar nikiedev
nikiedev - comment - 26 Jul 2016

version of Joomla 3.5.1. No extensions, I even reinstalled joomla 3.6 in other directory with new database - the same problem. Even changed version to php 5.6, but the warning is still there. Don't know what the reason is actually. What can it be? I use localhost (root, whithou password)

May be it wasn't at first and then appeared, I can't exactly say it.

Warning: Parameter 1 to ContentHelper::countItems() expected to be a reference, value given in D:\OpenServer\domains\joomla-test.local\administrator\components\com_categories\models\categories.php on line 403

avatar HLeithner
HLeithner - comment - 26 Jul 2016

The Problem is in this commit:

d2577b7#diff-edb981daf19f46ce73d3828ab0df8454R400

@bembelimen didn't notice that

call_user_func(array($cName, 'countItems'), $items, $section);

can't give parameter per reference to the called function and in PHP 7.0 this raises a warning.

I use Joomla 3.6, I changed it to $cName::countItems($items, $section); and it works again without warning.

btw. in this commit in line 395 there is $prefix = ucfirst(str_replace('com_', '', $component)); which is redundant to line 388 $eName = str_replace('com_', '', $component); so replaceing this with $prefix = ucfirst($eName); would be a good idea.

avatar nikiedev
nikiedev - comment - 26 Jul 2016

Thanks a lot! The problem is solved.

avatar KlintMX
KlintMX - comment - 26 Jul 2016

Had the same problem
Joomla 3.6 with several extensions and PHP 7.0.9
Problem solved

avatar brianteeman brianteeman - change - 28 Jul 2016
Priority Medium Urgent
Status New Confirmed
avatar brianteeman
brianteeman - comment - 28 Jul 2016

Anyone got a few minutes to look at this https://issues.joomla.org/tracker/joomla-cms/11274#event-184574 and do a PR please @rdeutz @bembelimen


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

avatar brianteeman
brianteeman - comment - 28 Jul 2016

Closed as we have a PR
@KlintMX @nikiedev @HLeithner can you please test #11337

avatar brianteeman brianteeman - change - 28 Jul 2016
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2016-07-28 16:01:04
Closed_By brianteeman
avatar brianteeman brianteeman - close - 28 Jul 2016
avatar KlintMX
KlintMX - comment - 28 Jul 2016

I've tested #11337 - no errors


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 28 Jul 2016

@KlintMX please mark as tested with success in #11337

Add a Comment

Login with GitHub to post a comment