3064 Posts in 865 Topics by 647 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1035 Views |
-
Issue with has_many

25 January 2010 at 11:48pm Last edited: 25 January 2010 11:49pm
I have got a small issue with the has_many relation. I just make it short and I hope it is enough to follow
class1 extends userdefinedform
has_many -> 'TeamPages' => 'Class2'
class2 extends Page
has_one -> 'Team' => 'Class1'
now i add a hasmanycomplextablefield
function getCMSFields() {
$fields = parent::getCMSFields();
$tablefield = new HasManyComplexTableField(
$this,
'TeamPages',
'Class2',
array(
'Title' => 'Name',
'Email' => 'Email',
'PhoneNumber' => 'Phone'
),
'getCMSFields_forPopup'
);
$tablefield->setParentClass('Class1');
$fields->addFieldToTab( 'Root.Content.AddTeamMember', $tablefield );return $fields;
}Now the issue. I have created a template for class1 and tryed to access TeamPages. I have checked my entries in the complex table so that something comes back when I do <% control TeamPages %>. But it didnt. Then i updated one entry inside (or outside) of the complex table and now the entry is visible in my template. I flush(all) all the time so there should not be the issue. Can anyone confirm that ?? Ah I use the latest version 2.3.5
Thx for every hint or answer
Thomas -
Re: Issue with has_many

11 February 2010 at 2:20pm
hey teejay,
I'm no guru but if class1 extends userdefinedform I don't think you can <% control TeamPages %>, isn't that only Viewable data?
I don't really understand the issue that well. You tried controlling a relationship without data entries, then you added some data, then the info showed, and you flush all the time. What to you need confirmation on?
I think I might be wrong about the userdefinedform I guess it is viewable data.... -
Re: Issue with has_many

11 February 2010 at 2:30pm
Nope you are wrong UserDefinedForm extends Page. This is just a very strange issue and I have atm no explanation for it.
-
Re: Issue with has_many

21 February 2010 at 7:17pm
ManyManyCTF has a similar issue: http://open.silverstripe.org/ticket/4706
| 1035 Views | ||
|
Page:
1
|
Go to Top |



