I'm having a problem. I have multiple Images Attached to a DataObject and an onBeforeWrite that builds relation to the image file based on Data on DataObject. This all works fine. however the when I open the DataObject in ModelAdmin the attached images don't show up in the ImageField. The images IDs associate properly as I'm using a custom getter for the Summary FIelds and I can see the images with it.
Has One Relation:
static $has_one = array (
"FrontWeb_Image" => "BetterImage",
"BackWeb_Image" => "BetterImage",
"FrontHi_Image" => "BetterImage",
"BackHi_Image" => "BetterImage",
);
Custom Getter for Summary Field:
public function getSummaryImage() {
if ($this->FrontWeb_ImageID) {
$image = DataObject::get_by_id("File", $this->FrontWeb_ImageID);
return $image->setWidth(100);
} else {
return "No Image Available";
}
}
BetterImage is just an image quality function based on http://www.ssbits.com/tutorials/2011/improving-image-quality-by-preventing-correctly-sized-images-being-resized/
The Thumbnails do show if I manually add the image from the ImageField.
If this is impossible another option I'm willing to use is listing the images in a CompositeField but custom getters won't work inside the getCMSFields function.
Thanks for any help