7939 Posts in 1472 Topics by 944 members
|Go to End|
5 April 2010 at 12:26am
Major brainfreeze I think. Really struggling to implement a ManyManyFileDataObjectManager.
I have a 'ResourcePage' which I would like to have a many-many relationship with a subclass of File, 'ResourceFile'.
ResourcePage has manymany of 'ResourceFiles' => 'ResourceFile' and Resource File has a belongs_many_many of 'ResourcePages' => 'ResourcePage' and the following is how I'm trying to initialise the ManyManyFileDOM.
'Name' => 'Name'
But TBH the above is me just taking a stab in the dark after many attempts. The error I get when trying to create a ResourcePage in the CMS is:
ERROR [Warning]: Missing argument 3 for FileDataObjectManager_Item::__construct(), called in /path/to/www/sapphire/forms/ComplexTableField.php on line 297 and defined
IN POST /admin/getitem?ID=108&ajax=1
Line 648 in /path/to/www/dataobject_manager/code/FileDataObjectManager.php
Is anyone able to correct the above code, or rather and preferably, show me an example of a working HasMany / ManyManyFileDataObjectManager? Would be most excellent.
Also, I'm currently using 2.4rc1.
5 April 2010 at 2:12am
First, you can't manage a relationship directly to File objects or subclasses thereof. You need to create a DataObject that contains a file, as shown in the documentation for FileDOM.
Also, around r380 or so, the source code was branched to support 2.4 and 2.3. 2.4 is on the trunk, so make sure you're on the latest rev.
5 April 2010 at 3:06am
Thanks for your reply. I knew there would be some big forehead-slap worthy thing that I had missed. Gosh. I'll give it a whirl in the morning and hopefully all should be fine.
I'm pretty sure I'm on the latest or close-to rev, but will run an update to be sure, thanks.
|Go to Top|