Hi everyone
I have built a page "property details", however it now wont save and publish and of my "properties", i just get the little ajax loading symbol over the button, but it doesnt save... how do I debug where it might be getting stuck? I already have
Director::set_environment_type("dev");
turned on. This is my code....
<?php
class PropertyDetail extends Page {
public static $db = array(
'PropertyName' => 'Text',
'RentPerMonth' => 'Currency',
'NumberOfBeds' => 'Int',
'Location' => 'Text',
'Postcode' => 'Text',
'StreetName' => 'Text',
'Lat' => 'Text',
'Long' => 'Text'
);
public static $has_one = array(
'SearchResultPicture' => 'Image'
);
public static $has_many = array(
'ImageResources' => 'ImageResource'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new ImageField('SearchResultPicture'));
$fields->addFieldToTab("Root.Content.Main", new TextField('PropertyName'));
$fields->addFieldToTab("Root.Content.Main", new CurrencyField('RentPerMonth'));
$fields->addFieldToTab("Root.Content.Main", new NumericField('NumberOfBeds'));
$fields->addFieldToTab("Root.Content.Main", new TextField('Location'));
$fields->addFieldToTab("Root.Content.Main", new TextField('Postcode'));
$fields->addFieldToTab("Root.Content.Main", new TextField('StreetName'));
$fields->addFieldToTab("Root.Content.Main", new TextField('Lat'));
$fields->addFieldToTab("Root.Content.Main", new TextField('Long'));
$managerimages = new ImageDataObjectManager(
$this, // Controller
'Images', // Source name
'ImageResource', // Source class
'Attachment', // File name on DataObject
array(
'Title' => 'Title'
), // Headings
'getCMSFields_forPopup' // Detail fields
// Filter clause
// Sort clause
// Join clause
);
$fields->addFieldToTab("Root.Content.Image Gallery",$managerimages);
return $fields;
}
}
class PropertyDetail_Controller extends Page_Controller {
public static $allowed_actions = array (
);
public function init() {
parent::init();
}
}
Thanks!