Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Error while iterating over moderators forums (missing precheck for forum presence) #131

Open
truemirror opened this issue Dec 19, 2017 · 4 comments
Assignees
Labels

Comments

@truemirror
Copy link

moderator haven't moderator's panel in thread and when anybody want to see his profile - error
error log : "'yii\base\ErrorException' with message 'Trying to get property of non-object' in /home/www/site.com/vendor/bizley/podium/src/views/members/view.php:109"
dump of $model->mods :
0 => bizley\podium\models\Mod#1 ( [yii\db\BaseActiveRecord:_attributes] => [ 'id' => 14 'user_id' => 29 'forum_id' => 27 ] [yii\db\BaseActiveRecord:_oldAttributes] => [ 'id' => 14 'user_id' => 29 'forum_id' => 27 ] [yii\db\BaseActiveRecord:_related] => [] [yii\base\Model:_errors] => null [yii\base\Model:_validators] => null [yii\base\Model:_scenario] => 'default' [yii\base\Component:_events] => [] [yii\base\Component:_behaviors] => [] )

@bizley
Copy link
Owner

bizley commented Dec 21, 2017

Have you by any chance deleted manually forum entry with the ID 27 in your database?

@bizley
Copy link
Owner

bizley commented Dec 21, 2017

But nevertheless there should be additional check for existance of this.

@bizley bizley self-assigned this Dec 21, 2017
@bizley bizley added the bug label Dec 21, 2017
@bizley bizley changed the title rbac error Error while iterating over moderators forums (missing precheck for forum presence) Dec 21, 2017
@truemirror
Copy link
Author

truemirror commented Dec 21, 2017

Have you by any chance deleted manually forum entry with the ID 27 in your database

forum entry with the ID 27 exist in database. Same error with any existing forum entries and with any users who has moderator role

@truemirror
Copy link
Author

truemirror commented Jan 3, 2018

when in yii2-podium/src/models/Thread.php line 249
if (in_array($userId, $this->forum->getMods())) {
change to
if (User::can(Rbac::ROLE_MODERATOR)) {
moderator's panel present, for each moderator in all threads (like Admin)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants