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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

DataObject file upload gives not found


Reply


2 Posts   849 Views

Avatar
priithansen

Community Member, 25 Posts

27 June 2012 at 5:19am

Edited: 27/06/2012 5:22am

With SS3 RC1 and RC2 can't upload images for dataobjects.

<?php
class MapsPage extends Page {
   static $has_many = array (
      'SmallMaps' => 'SmallMap'
   );
   public function getCMSFields() {
      $fields = parent::getCMSFields();

      $gridField = new GridField("SmallMaps", "Maps list:", $this->SmallMaps(), GridFieldConfig_RelationEditor::create());
      $fields->addFieldToTab("Root.Maps", $gridField);
      
      return $fields;
   }
}


<?php
class SmallMap extends DataObject {
   public static $has_one = array(
      'MapThumbnail' => 'Image',
      'MapsPages' => 'MapsPage'
   );

When I select a SmallMap from MapsPage GridField and try to Upload a MapThumbnail Image from computer the UploadField shows a "not found" error.
Adding a picture from already uploaded files works ok.

The POST request that returns 404 is ss3/admin/pages/edit/EditForm/field/SmallMaps/item/9/ItemEditForm/field/MapThumbnail/upload

Uploading from ModelAdmin for the same DataObject works just fine.

Is there something missing from my code or could this be a bug?

Avatar
shmayek

Community Member, 3 Posts

27 June 2012 at 7:58pm

Look at this thread http://www.silverstripe.org/general-questions/show/20011?start=0
Definitely there is a problem with SS3.