Add var $name = 'User'; & var $name = 'UserProfile'; as properties in your models and I think you're golden :-)
On May 24, 10:19 am, francky06l <[EMAIL PROTECTED]> wrote: > Can you pass your model definition code ? > I have the same kind of plugin and not much problems, maybe I declare > the association in different way. > I set the plugin name into the className parameter ie : > belongTo => array('Profile' => array('className' => > 'user.Profile') .... > > Wich cake version are you using ? > > On May 24, 12:05 am, "Christopher E. Franklin, Sr." > > <[EMAIL PROTECTED]> wrote: > > On May 23, 2:49 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > > If the user model is in the plugin it should not a problem.. Maybe the > > > problem is how you call the find and from where ? > > > I do the find in the UsersController::read() function. It seems to me > > that it is a problem with the association because, when I set > > $this->User->recursive = -1; I get back just the user. But, anything else, > > > it tries to pull the UserProfile and screws up. > > > > I guess this is when you try to find user from the application and not > > > the plugin ? > > > No, I make the call from the users_controller in the plugin. > > > >Maybe the problem comes from the "calling" rather than > > > the callee ? > > > I don't see a problem with $this->User->findById(1); but, like I said, > > if I set recursive to -1 I get the user I want but, not the > > user_profile. I wanted to get both. > > > Alternatively, I can set the UserModel and UserProfileModel both to > > recursive = -1 and just live with the extra calls but, this would be a > > pain if I want to find all users. > > > I have also tried declaring different $hasOne and $belongsTo without > > the plugin name like, 'User' instead of 'users.User' but, if I do > > that, it says that it cannot find the database table user_profiles for > > the 'UserProfile' model. > > > > hth > > > Thank you for replying :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---