From: "Dardo Sordi Bogado" <dardoso...@gmail.com>
Date: Tue, 1 Apr 2008 17:55:44 -0300
Local: Tues, Apr 1 2008 4:55 pm
Subject: Re: Polymorphic not returning associated fields
There is a bug in the behavior that make it fetch only id and
displayfield (that is a virtual field and is documented in the behavior. ). In the line 45, change: array('id', $model->$class->displayField), null, -1); null, null, -1); Link to fixed version: http://bin.cakephp.org/view/1702492171 This is the patch: ----------BEGIN-PATCH------------------- On Tue, Apr 1, 2008 at 12:38 PM, rob5408 <rob5...@gmail.com> wrote:
> > 1. A litle background about what are you trying to do. > I have Person information that is common to all people (name, > > 2. The code you are using to define the models. > class Person extends AppModel { > var $name = 'Person'; > // The database table for this model includes 'class' and > class CoachRating extends AppModel { > var $name = 'CoachRating'; > var $hasMany = array( > } > > 3. How are you calling the models. > When I go to view one Person in particular, I use > $this->set('person', $this->Person->read(null, $id)); > > 4. The SQL that is beign generated. > SELECT `Person`.`id`, `Person`.`birthdate`, `Person`.`firstname`, > > 5. The version of cake you are using. > 1.2.0.6311 beta > Thanks! rob > On Apr 1, 11:24 am, "Dardo Sordi Bogado" <dardoso...@gmail.com> wrote: > > 1. A litle background about what are you trying to do. > > On Tue, Apr 1, 2008 at 12:11 PM, rob5408 <rob5...@gmail.com> wrote: > > > I followed the Bakery page on setting up my db and models for the > > > Array > > > [CoachRating] => Array > > > ) > > > but 'display_field' isn't a field in CoachRating table and there's two You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||