Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » FileUploads and the DOM + SWFUpload

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 3366 Views
  • hive.net.au
    Avatar
    Community Member
    40 Posts

    FileUploads and the DOM + SWFUpload Link to this post

    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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: FileUploads and the DOM + SWFUpload Link to this post

    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?

  • hive.net.au
    Avatar
    Community Member
    40 Posts

    Re: FileUploads and the DOM + SWFUpload Link to this post

    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?

  • hive.net.au
    Avatar
    Community Member
    40 Posts

    Re: FileUploads and the DOM + SWFUpload Link to this post

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

  • timwjohn
    Avatar
    Community Member
    98 Posts

    Re: FileUploads and the DOM + SWFUpload Link to this post

    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...

  • kiwiot
    Avatar
    Community Member
    8 Posts

    Re: FileUploads and the DOM + SWFUpload Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: FileUploads and the DOM + SWFUpload Link to this post

    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.

  • kiwiot
    Avatar
    Community Member
    8 Posts

    Re: FileUploads and the DOM + SWFUpload Link to this post

    I'm using

    modules-dataobject_manager-r395
    modules-swfupload-r375

    with Silverstripe 2.4.0

    Is this correct and up-to-date?

    3366 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.