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

FileUploads and the DOM + SWFUpload


Go to End


14 Posts   5336 Views

Avatar
hive.net.au

Community Member, 40 Posts

29 March 2010 at 9:09pm

Edited: 29/03/2010 9:12pm

Hi Uncle Cheese,

Big fan of your work, i am having a little issue with the latest trunk version of DOM, SWFUpload and SilverStripe 2.4 Beta2. We have popups with the following code.

public function getCMSFields_forPopup()
	{
		return new FieldSet(
			new TextField('Title'),
			new SimpleHTMLEditorField('Description','Description'),
			new SWFUploadFileIFrameField('FeatureImage','Feature Image')
		);
	}

We originally just had FileIFrameField but as you know the dropdown list does not work so it is impossible to select already uploaded images. So i decided to see if we can use SWFupload however we get the following error

Fatal error: Class 'Image_Uploader' not found in /path/to/files/SWFUploadFileIFrameField.php on line 47

As it appears Image_Uploader class is no longer in the core image.php file?

Any ideas, am i wasting my time will i be able to select existing files with in a popup using DOM and SWFupload?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

30 March 2010 at 4:09am

Interesting.. looks like they finally sunsetted that Image_Uploader class. It's been obsolete ever since form fields became their own controllers. It seems like the fix might be as easy as changing the parent class from Image_Uploader to "FileIFrameField".. can you try that?

Avatar
hive.net.au

Community Member, 40 Posts

30 March 2010 at 10:02am

After making the change the following error occurs
[Warning] Missing argument 1 for FileField::__construct(),
in /path/to/file/sapphire/core/control/Director.php on line 280 and defined
GET /path/to/file/swfuploadfile/iframe/ProductFeature/15/FeatureImage
Line 78 in /path/to/file/sapphire/forms/FileField.php

I also noticed that the SWFUploadFileIFrameField still uses the TreeDropdownField so i dont think it will resolve our problem. Do you know of a solution to allow the selection of exsisting uploads in the popup?

Avatar
hive.net.au

Community Member, 40 Posts

31 March 2010 at 3:53am

All good latest trunk of 2.4 solves the issues. :) Its a good day.

Avatar
timwjohn

Community Member, 98 Posts

9 April 2010 at 6:34am

Guys, I'm trying to get a SWFUploadFileIFrameField to replace an image field in ModelAdmin and getting the same error: Fatal error: Class 'Image_Uploader' not found in /path/to/files/SWFUploadFileIFrameField.php on line 47

The reason I'm trying to use a SWFUpload field is that I'm finding it impossible to set the allowed extensions on my image and pdf fields. It's driving me nuts. I'm using 2.4-rc1...

Avatar
kiwiot

Community Member, 8 Posts

14 May 2010 at 7:05am

Hi,

I'm new to Silverstripe and trying to implement multiple files on a form page. I have tried uploading with SWFUpload but am having the same issues as hive.net.au. I tried installing DOM, but it just doesn't seem to not work with the latest stable version of SS 2.4.

Either there is an issue with the Image_Uploader, cannot find SimpleWysiwygField, or I simply get a blank tab when trying to implement the Resource example.

Is there any way to solve these issues or is there a better way to attach multple files/images to a form page that will stop the hours of frustration that this evening has been?

Thanks in advance.
J

Avatar
UncleCheese

Forum Moderator, 4102 Posts

14 May 2010 at 7:10am

The trunk version of DOM is 2.4... the 2.3 version was branched off around rev 385 or so. Make sure your code is up to date.

Avatar
kiwiot

Community Member, 8 Posts

14 May 2010 at 7:19am

I'm using

modules-dataobject_manager-r395
modules-swfupload-r375

with Silverstripe 2.4.0

Is this correct and up-to-date?

Go to Top