Hello,
I have been working with DataOjectManager module for sometime now i am so much in love with the thing. Recently i have been having the following stack trace error pop up whenever i try post a new image using a new page type i have recently created. I can see that everything saves just after i close the fancybox window but the initial saving is where the problem is. Below is some of the stack trace error code.
[Warning] DataObject::get_by_id passed a non-numeric ID #18
POST /projectName/admin/EditForm/field/Homes/UploadForm?ctf[Homes][per_page]=10&ctf[Homes][showall]=0&ctf[Homes][sort]=Created&ctf[Homes][sort_dir]=DESC&ctf[Homes][search]=&ctf[Homes][filter]=&ctf[Homes][view]=grid&ctf[Homes][imagesize]=100
Line 2413 in C:\wamp\www\projectName\sapphire\core\model\DataObject.php
This is the code for the new page type class extending the DataObject class
<?php
class Home extends DataObject
{
static $db = array (
'Name' => 'Text',
'PhotoDescription' => 'HTMLText(1024)'
);
static $has_one = array (
'Photo' => 'Image',
'HomePage' => 'HomePage'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new TextField('Name'),
new TextareaField('PhotoDescription', 'Photo Description'),
new ImageField('Photo')
);
}
}
?>
and finally here is some of the code for the PageType Model itself
class HomePage extends Page
{
static $db = array(
//'Introduction' => 'HTMLVarchar',
'GoalsAndObjectives' => 'HTMLVarchar(5000)'
);
static $has_one = array(
"InternalLink" => "SiteTree",
);
static $has_many = array (
'Homes' => 'Home'
);
static $icon = "themes/light/images/treeicons/home";
public function getCMSFields()
{
$fields = parent::getCMSFields();
$manager = new ImageDataObjectManager(
$this, // Controller
'Homes', // Source name
'Home', // Source class
'Photo', // File name on DataObject
array(
'Name' => 'Name',
'PhotoDescription' => 'PhotoDescription'
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$fields->addFieldToTab("Root.Content.Photo Slide Show", $manager);
$fields->addFieldToTab("Root.Content.Featured Link", new TreeDropdownField("InternalLinkID", "InternalLink", "SiteTree"));
$fields->addFieldToTab("Root.Content.Main", new HTMLEditorField("GoalsAndObjectives", "Goals and Objectives"));
return $fields;
}
}
I am running the Latest SVN build (142) of the DOM module. This is my first forum post here and also the first time i am have encountered an error like this. Any help will be greatly appreciated. Thank you. :D