ok i played around a little bit and now i think to know what could be the problem.
i build this imagedataobject
ScreenObject
<?php
class ScreenObject extends DataObject {
public static $db = array(
'Description' => 'Text'
);
public static $has_one = array(
'Screen' => 'Image',
'ReferencePage' => 'ReferencePage'
);
public function getCMSFields_forPopup() {
return new FieldSet(
new TextField('Description', 'Beschreibung'),
new ImageField('Screen', 'Screenshot')
);
}
}
?>
and included it into this page
ReferencePage
<?php
class ReferencePage extends Page {
...
...
public static $has_many = array(
'Screens' => 'ScreenObject'
);
function getCMSFields() {
$fields = parent::getCMSFields();
...
...
$fields->addFieldToTab('Root.Content.Screens', new ImageDataObjectManager($this, 'Screens', 'ScreenObject', 'Screen', array('Description' => 'Beschreibung'), 'getCMSFields_forPopup'));
...
return $fields;
}
...
...
}
class ReferencePage_Controller extends Page_Controller {
}
?>
at first. is there an any mistake i made?
ok.
now im uploading an image
1) choose the ReferencePage
2) clicking the Screens Tab
3) clicking the "Add Screen Object" Button
4) choosing "assets/folder" from the dropdown selection
5) clicking the change button
6) browse files.
7) waiting until the upload is complete
Now the image is in the right folder. BUT to save the image into the imagedataobject i have to click continue button and now a copy of the image is moved to uploades and saved there. and this copy is shown on my site and not the original one in the right folder
do you know what i mean?
is there a mistake in my code?
how can i solve this problem?