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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

LeftAndMain: The UncleCheese Blog


Go to End


19 Posts   4902 Views

Avatar
Stefdv

Community Member, 110 Posts

26 November 2010 at 5:26am

UC,

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>

To

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

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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 November 2010 at 5:50am

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. http://www.leftandmain.com

Avatar
Stefdv

Community Member, 110 Posts

26 November 2010 at 6:04am

Edited: 26/11/2010 8:20am

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?

[EDIT]

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]

[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]

<CODE>
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
(
$this,
'SerieSeasons',
'SerieSeason',
array('SeasonNmbr' => 'Seizoen')));

}
</CODE>

Tx again

Go to Top