Dennis
Dennis

Reputation: 2964

MilesJ's Forum Plugin and CakeDC's Users Plugin

How can I implement MilesJ's Forum Plugin with CakeDC's Users Plugin?

The instructions for implement the Forum Plugin at http://milesj.me/code/cakephp/forum#user-setup. It does not however anticipate the Users system using a Plugin.

This is the model "AppUser" (name forced by CakeDC):

App::uses('User', 'Users.Model');

class AppUser extends User {
    public $useTable = 'users';
    public $hasOne = array('Forum.Profile');    
    public $hasMany = array('Forum.Access','Forum.Moderator'));

}

I keep on getting the following errors...

Warning (512): Model "User" is not associated with model "Profile" [CORE\Cake\Model\Behavior\ContainableBehavior.php, line 339]
Warning (512): Model "User" is not associated with model "Access" [CORE\Cake\Model\Behavior\ContainableBehavior.php, line 339]
Warning (512): Model "User" is not associated with model "Profile" [CORE\Cake\Model\Behavior\ContainableBehavior.php, line 339]
Warning (512): Model "User" is not associated with model "Access" [CORE\Cake\Model\Behavior\ContainableBehavior.php, line 339]

How can I be sure to have the proper relations between the Forum and Users plug-in?

Upvotes: 2

Views: 866

Answers (1)

AnNaMaLaI
AnNaMaLaI

Reputation: 4084

  1. Download the Plugin and Put inside Plugin folder -> app/Plugin/
  2. Rename the Folder name to 'Forum'.
  3. Now go to app/Plugin/Forum/Config/Schema

    folder and put all the sql files in to your database with prefix of 'forum_'

  4. If your are using auth component then it will work automatically , Once done the above step go to http://example.com/forum/ 5.Then add the following Relationship in your User Model(of your project)

    public $hasOne = array('Profile' => array(

            'className' => 'Profile',
    
            'foreignKey' => 'user_id',
    
            'dependent' => true,
    
            'conditions' => '',
    
            'fields' => '',
    
            'order' => '',
    
            'limit' => '',
    
            'offset' => '',
    
            'exclusive' => '',
    
            'finderQuery' => '',
    
            'counterQuery' => ''
    
        ),
       )
    
  5. Then same for Access in has Many Relation ship
  6. Then u will get the error Fatal error: Call to a member function image() on a non-object in /var/www/projectname/app/Plugin/Utils/View/Helper/GravatarHelper.php on line 89

for these put your HTML helper inside that app/Plugin/Utils/View/Helper/

Finally everything needs to work.. Just now i started implementing this.. If you face any error let me know

Upvotes: 0

Related Questions