I'm hoping someone is going to be able to shed some light on an issue I'm having with ModelAdmin. I using ModelAdmin to manage data associated with a jquery carousel.
Here is what I have:
Data Object
<?php
class CarouselItem extends DataObject {
static $db = array(
'Caption' => 'Text',
'URL' => 'Varchar(255)'
);
static $has_one = array(
'Photo' => 'Image'
);
static $summary_fields = array(
'URL',
'Created',
'LastEdited'
);
}
?>
ModelAdmin code
<?php
class CarouselAdmin extends ModelAdmin
{
public static $managed_models = array(
'CarouselItem'
);
static $url_segment = 'carousel';
static $menu_title = 'Carousel Data';
}
?>
The above seems to work ok when it comes to saving the CarouselItem apart from the relationship to the image. The $has_one seems to create a PhotoID field on the CarouselItem table however this is the only field that is not updated when managing this data. Also I get a quick fade in message when attempting to select an image - the message that fades in is "Forbidden".
Am I missing something here ?
Any assistance would be greatly appreciated.