Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

hasmanycomplextablefield still not working ( in SVN build, works fine in stable )


Go to End


6 Posts   3036 Views

Avatar
OzziNL

Community Member, 37 Posts

28 December 2007 at 6:02am

Edited: 04/01/2008 9:38am

Hi there,

I am trying the tutorial 5 Mentor - student relation but still getting:

ERROR:Error 512: ComplexTableField::DetailForm() Cannot automatically determine 'has-one'-relationship to parent, please use setParentClass() to set it manually At l266 in /usr/home/inventheon/www/sapphire/forms/ComplexTableField.php 

Don't know where to put the setParentClass() to get it working. In the demo it is working ... can somebody help me please?! I need it very urgent!

Regards,
OzziNL

Avatar
OzziNL

Community Member, 37 Posts

3 January 2008 at 10:19pm

Hello,

Isn't there anybody that has this problem? I need the 1-to-many structure very urgent?

Isn't it possible to get some code of the demo pages? Because there the student-mentor example is working but if you download the code of tutorial 5, this isn't?

Or is the demo site not running on the latest SVN version?

I hope someone can help me...

Oscar

Avatar
Ingo

Forum Moderator, 801 Posts

5 January 2008 at 9:38pm

hm, just tested the tutorial-code against the latest phpinstaller (branches/2.2.1), worked fine.
if you want to explicitly set your relation-class, add the following to Project->getCMSFields():
<code>
$tablefield->setParentClass('Project');
</code>

Avatar
OzziNL

Community Member, 37 Posts

9 January 2008 at 1:18am

Indeed, it's working in the phpInstaller version.

But not in the latest SVN version. FYI...

Regards,
Oscar

Avatar
Ingo

Forum Moderator, 801 Posts

9 January 2008 at 10:59am

you're right, we managed to break this by merging old code from a project-branch of sapphire - should be fixed in http://open.silverstripe.com/changeset/47747.
can you please test that this fix works for you?

Avatar
OzziNL

Community Member, 37 Posts

9 January 2008 at 11:59am

I'll do that tomorrow...bedtime here ;)