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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

SWFUploadFileIFrameField and SS 2.4


Go to End


9 Posts   2575 Views

Avatar
brice

Community Member, 52 Posts

15 June 2010 at 9:04am

Edited: 15/06/2010 9:08am

According to http://www.silverstripe.org/dataobjectmanager-module-forum/show/281838 the Image_Uploader class that SWFUploadFileIFrameField extends has been removed from the core of SilverStripe 2.4...

So I went ahead and modified SWFUploadFileIFrameField to extend FileIFrameField as per UncleCheese's query in the above post and now get:

Error: Uncaught Exception: Object->__call(): the method 'setsession' does not exist on 'SWFUploadFileIFrameField_Uploader' At line 724 in ...\sapphire\core\Object.php

When I try to leverage the SWFUploadFileIFrameField to perform a large video upload with progress meter.

My DataObject code is as follows:

class TestVideo extends DataObject {

	static $db = array(
		"Title"		=> "Varchar(255)"
	);

	static $has_one = array(
		"Video"		=> "File"
	);

	public function getCMSFields() {

       $fields = parent::getCMSFields();
	   $fields->addFieldToTab("Root.Main", new SWFUploadFileIFrameField('Video','Video','Upload a file'));
	   return $fields;

    }
}

I am using the latest trunk of SWFUpload extension. Is it truly 2.4 compatible && I'm implementing it wrongly?? Or does the code need to be updated/tested on 2.4? Please let me know if anyone has it working.

Thanks!

~ Brice

Avatar
brice

Community Member, 52 Posts

17 June 2010 at 5:07am

I see that "class SWFUploadFileIFrameField_Uploader extends Image_Uploader" in the latest version (r400 from SVN) of SWFUploadField module. Line 55 of the module's _config.php also references this class:

Director::addRules(10, array(
	'swfuploadfile/$Action/$Class/$ID/$Field' => 'SWFUploadFileIFrameField_Uploader'
));

As the "Image_Uploader" class has been removed from SS 2.4 -- is the module still compatible?? Has anyone been able to use it in outside of DOM in a getCMSFields overload [In 2.4]?

It seems that the DOM version of it works... I believe it's because there is reference tot he form & that it's using SWFUploadField and not SWFUploadFileIFrameField ???

Thanks,

~ Brice

Avatar
brice

Community Member, 52 Posts

19 June 2010 at 2:51am

I believe the base of this issue is that the Image_Uploader class extended controller, while the FileIFrameField class (that we were asked to experiment with) does not. Hence SetSession not being available.

UncleCheese -> is it possible to get some feedback on this?

Thanks,

~ Brice

Avatar
Tonyair

Community Member, 81 Posts

26 June 2010 at 4:52am

I have the same issue.

SS 2.4 rev. 107083 (just updated)

Avatar
Tonyair

Community Member, 81 Posts

26 June 2010 at 5:18am

Edited: 26/06/2010 5:23am

I extended it from Upload class cos it's logically clean and looks very similar according to 2.4 api
"class SWFUploadFileIFrameField_Uploader extends Upload"

I've got error that SWFUploadFileIFrameField.ss, Upload.ss, Upload_iframe.ss and SWFUploadFileIFrameField.ss not found and really i can't find it in the modules folders there're only empty template folders, so I created this files, but of course nothing is displayed now

any ideas?

By the way it works perfectly in the assets with dataobject_manager

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 June 2010 at 5:38am

Guys, just a heads up:

1) I haven't supported SWFUploadIFrameField in almost a year. It never worked correctly.

2) I'm going to be nuking the whole SWFUpload module very soon in favor of a more stable plugin, and you'll be able to use it interchangeably with FileIFrameField in the CMS. I'm just ironing out the bugs now, but if you can wait just a little longer, there's a much better solution on the way.

Avatar
Tonyair

Community Member, 81 Posts

26 June 2010 at 6:44am

don't waste ur time i think it needs just some simple addition, for example $FormName variable in the templates, I'll send it here when I finish additions for my own website

Avatar
brice

Community Member, 52 Posts

26 June 2010 at 7:01am

UncleCheese,

Thanks for the heads up! I'm looking forward to seeing your work. Please let me know if I can help test or work on anything in the meantime -- I'd be happy to lend some dev time.

~ Brice

Go to Top