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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

LeftAndMain: The UncleCheese Blog


19 Posts   2379 Views


26 November 2010 at 5:26am Community Member, 110 Posts


I have a new challenge...

After upgrading to SS 2.4.3 everything seemed okay, i did nt have the HTTP Error anymore, but ...

I also have some ImageUploadFields, the strange thing is that they are working if i use ModelAdmin, but if i manage my objects in the Page i only get a textfield showing the Image ID. No Uploadify what so ever. I had to change the parameters in my ImageUploadField from

<CODE>          new ImageUploadField('Photo', 'Foto',Null,Null,Null,'SomeImagePage/Images') </CODE>


<CODE> new ImageUploadField('Photo', 'Foto') </CODE>

Because i got an error concerning Uploadify when i tried to open my (Object)page for editing.


26 November 2010 at 5:50am 4085 Posts

This looks like too many parameters for an UploadifyField:

new ImageUploadField('Photo', 'Foto',Null,Null,Null,'SomeImagePage/Images')

To set the upload folder, just use $your_uploadify_field->setUploadFolder('SomeImagePage/Images');

Silverstripe tips, tutorials, screencasts, and more.


26 November 2010 at 6:04am (Last edited: 26 November 2010 8:20am), Community Member, 110 Posts

Okay UncleCheese,

Got that.

But what about the thing that i can not use the uploadify field in my page but can use it in ModelAdmin?


In fact the Uploadify field is working when i ad a new Object ( A Serie in my case), but it doesn t show when i want to edit an existing Serie. Then it only shows an textfield with the Series ID.


[EDIT 2]

This might help...If i edit an Object, the popup opens and the imagefield shows only the image ID. When i click on {Next} the Uploadify box shows, then when i click {Previous} the box shows where it first only showed a textfield. So it seems that it is some kind of refresh...but then again ... What do i know LOL

ps. The same *.php files works in SS 2.4.2 but then i have HTTP errors in FileUploadFields ( posted that somewhere else)

[/EDIT 2]

public function getCMSFields()
      $fields = parent::getCMSFields();
      return new FieldSet
         new TextField('SerieName'),
         new TextField('Genre'),
         new TextareaField('Beschrijving'),
         new TextField('Server'),
         new TextField('Folder'),
         new ImageUploadField('Cover'),
         new DataObjectManager
               array('SeasonNmbr' => 'Seizoen')));


Tx again