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.

Customising the CMS

File Upload Field in ManyManyComplexTableField popup


21 Posts   3783 Views


22 November 2009 at 4:00am Community Member, 30 Posts

How does the DOM store it's data compared to the CTF?

Does it work in exactly the same way, so that I can just swap out DOM for CTF and keep all the data and relationships in tact?
The option to reorder entries looks like a real bonus, as that seems to be the biggest flaw with the CTF..

Carbon Crayon

22 November 2009 at 9:04am Community Member, 598 Posts

Yep, the DOM is just an extention of the CTF class. It pulls in the same data (i.e. DataObjects) and displays them in the same way just adding a new skin, more functionality and a much faster popup window. Honestly I don't think I could go back to a CTF now, it would just seem 98! :)


6 January 2010 at 2:52am (Last edited: 6 January 2010 2:53am), Community Member, 202 Posts

I copied the code here after creating my own code from scratch to try and correct an error. The problem is this: When using a FileIFrameField or ImageField I always get the the same message instead of FileIFrameField or ImageField in the popup:

'You can add files once you have saved for the first time.'

I can then save the record in the popup, close it, reopen the record for editing and THEN I can add a file.

I know where this comes from, it has to do with line 14 in sapphire/forms/FileIFrameField.php:

$data = $this->form->getRecord(); // returns no data

Somebody know what I can do about this? (Creating a mysite/forms/MyFileIFrame.php class for instance, but am not sure what to change or add)

EDIT: tested it on 2.3.3 and 2.3.4

Carbon Crayon

6 January 2010 at 3:13am Community Member, 598 Posts

I don't think you can do anyuthing, this comes from the fact that before you save it the DataObject has no ID so it cannot have relationships like attaching an image. However when using DOM it should refresh when pressing save so that you can add the image strait away without having to open the popup again.



6 January 2010 at 12:27pm Community Member, 202 Posts

Thanks for the reply - I will look into using DOM.