You can find it in the script YiiForumModule.php located in the root of the module package.
You can find it in the script YiiForumModule.php located in the root of the module package.
Good Afternoon all. I’m kind of a newbie.
This is my first attempt at installing a module. I’m attempting to install the Forum module onto an “out-of-the-box” Yii installation. I followed the instructions to download and modify files. I got Forum to open initially, but then ran into some problems. I’ve read this forum and have implemented some of the suggested fixes - thank you all. The error I’m getting right now is:
Property "CWebUser.isAdmin" is not defined.
I have added the line:
$this->setState('isAdmin', ($this->name == 'admin'));
in the UserIdentity.php file
This shows up when I just try to access the Forum. Any thoughts? Any help or directions would be appreciated.
Thanks so much - Mike K
The question in return is how you have added the line to set the state for Yii::app()->user->isAdmin ?
The error you are getting seems to indicate that you are logged in while the state is not set, because in the code of a couple of views of that module I read:
$isAdmin = !Yii::app()->user->isGuest && Yii::app()->user->isAdmin;
If this info does not help, can you post your UserIdentity.php so that we can have a look at it?
Good afternoon (again).
I had to put this issue aside for a bit. I was finally able to revisit installing the extension this past weekend.
I went through the exercise again and I’m not experiencing the problem any more.
I subsequently tried to add the extension to an existing app and the module seems to continue to behave as expected.
One question now is that the existing app uses a theme. The theme does not carry over into the extensions widget views. MIght there be a way to apply that gobally or do I have to modify each view?
Thank you to all for the responses!
Hello and good afternoon.
A bug showed up for me:
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'is_sticky' doesn't have a default value. The SQL statement executed was: INSERT INTO `thread` (`forum_id`, `subject`, `created`) VALUES (:yp0, :yp1, :yp2)
This occurs when someone tries to add a new thread to an existing topic/forum.
This occurs on my development AND production server.
Any suggestions?
Thank you for all help.
I fixed it. I modified the the MySQL table "thread" to have default values for the fields "is_sticky" (0), "is_locked" (0), and "view_count" (1).
No changes to the code.
Hi, Exist this extension for yii 2.0 advanced?