Jump to:

7939 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » [SOLVED] removeFolderSelection + Uploadify + DOM

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 649 Views
  • Ryan M.
    Avatar
    Community Member
    309 Posts

    [SOLVED] removeFolderSelection + Uploadify + DOM Link to this post

    I'm removing the upload folder selection & manually setting the upload folder on the DOM popup for a dataobject. Code below:

    public function getCMSFields_forPopup()
       {
          $upload = new ImageUploadField('Image');
          $upload->removeFolderSelection();
          $upload->uploadFolder = 'Photos';
          $f = new FieldSet(
             new TextField('Title'),
             new TextareaField('Description'),
             $upload
          );
          if($this->ID) {
             $f->push(new DropdownField('PhotoAlbumID', 'Attach to a Photo Album', $this->profileAlbumsDropdown()));
          }
          return $f;
       }

    When you're creating a new object, the upload folder selector is visible. However after saving it, then clicking to edit it in the DOM again, the folder selection is hidden, just like it's supposed to be. What gives?? Why is it displaying the selector at first, but not after creation?

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: [SOLVED] removeFolderSelection + Uploadify + DOM Link to this post

    I quickly discovered that because I'm using an ImageDOM, the initial creation of the object uses the DOM's default upload folder, while editing the object later on uses the ImageUploadField's upload folder. Weird.

    The solution was to also set the upload folder on the ImagDOM, however I don't think there's a method for removing the ability to change/select the upload folder.

    649 Views
Page: 1
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.