?
avatar 810
810
11 May 2016

Steps to reproduce the issue

Install Kunena
go to forum

Expected result

Running the component

Actual result

Call to a member function get() on string

System information (as much as possible)

J3.x
Php 7.0.6
PHP <= 7.0.5 Working normal

Additional comments

The code is running the JRegistry params

plugins\kunena\joomla\access.php line 260

Is this a PHP Bug, or Joomla bug, or our bug.
maybe this is the issue: https://bugs.php.net/bug.php?id=72117

@mbabker any idea?

avatar 810 810 - open - 11 May 2016
avatar mbabker
mbabker - comment - 11 May 2016

Can't tell. Your issue report references Kunena scripts. If you give something using only core it might be easier to trace but as is there are too many variables to try and debug this. Also Registry doesn't have __get() or __isset() methods so if it is that same PHP bug it's an odd mutation to say the least.

avatar 810
810 - comment - 11 May 2016

C:\Program Files (x86)\Zend\ZendServer\data\apps\http__default__\0\kunena\3.5.0_3\plugins\kunena\joomla\access.php:260

is this code:

public function getAuthoriseActions(KunenaForumCategory $category, $userid)
    {
        $groups = (array) JAccess::getGroupsByUser($userid, true);
        $post   = array_intersect($groups, (array) $category->params->get('access_post', array(2, 6, 8)));
        $reply  = array_intersect($groups, (array) $category->params->get('access_reply', array(2, 6, 8)));

        return array('topic.create' => !empty($post), 'topic.reply' => !empty($reply), 'topic.post.reply' => !empty($reply));
    }

and that's loaded this file:
C:\Program Files (x86)\Zend\ZendServer\data\apps\http__default__\0\kunena\3.5.0_3\libraries\kunena\forum\category\category.php

avatar mahagr
mahagr - comment - 12 May 2016

To me the error looks like that $category->params is a string, not Registry object. Not sure if it is related to the above change in PHP or not.

avatar brianteeman
brianteeman - comment - 12 May 2016

Closing as its not joomla core


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

avatar brianteeman brianteeman - close - 12 May 2016
avatar brianteeman brianteeman - close - 12 May 2016
avatar brianteeman brianteeman - change - 12 May 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-05-12 08:47:47
Closed_By brianteeman
avatar brianteeman brianteeman - close - 12 May 2016
avatar 810
810 - comment - 13 May 2016

We have fixed the issue by:
Before
$instances = (array) $db->loadObjectList('id', 'KunenaForumCategory');

After fix:

        $instances = (array) $db->loadObjectList('id', 'KunenaForumCategory');

        foreach ($instances as &$instance)
        {
            $instance = new KunenaForumCategory(array('id'=>$instance->id));
            $instance->load();
        }

avatar brianteeman brianteeman - change - 13 May 2016
Labels Added: ?

Add a Comment

Login with GitHub to post a comment