Hi, I've had a site running sweet with the DOM, and upgraded it to rev347 and now I get errors in the CMS (Undefined offset error). I've tracked it down to the Sort parameter...with anything in there I get the error....with no sort parameter specifed it works fine.
code is:
public function getCMSFields()
{
$f = parent::getCMSFields();
$manager = new DataObjectManager(
$this, // Controller
'Endangereds', // Source name
'Endangered', // Source class
array('Family' => 'Family', 'Genus' => 'Genus','Species' => 'Species','CommonName' => 'CommonName'), // Headings
'getCMSFields_forPopup' // Detail fields function or FieldSet
,""// Filter clause
,"Genus"// Sort clause
// Join clause
);
$f->addFieldToTab("Root.Content.EndangeredList", $manager);
return $f;
}
data object is:
class Endangered extends DataObject
{
static $db = array (
'Family' => 'Text',
'Genus' => 'Text',
'Hybrid' => 'Text',
'Species' => 'Text',
'Infraspecific' => 'Text',
'Cultivar' => 'Text',
'CultivarGroup' => 'Text',
'Synonym' => 'Text',
'CommonName' => 'Text',
'Continent' => 'Text',
'GeoRegion' => 'Text',
'Herbarium' => 'Boolean',
'IUCNCode' => 'Text',
'Fieldx1' => 'Text',
'Var' => 'Text'
);
static $has_one = array (
'EndangeredPage' => 'EndangeredPage',
'PlantImage' => 'Image'
);
static $searchable_fields = array(
'Family','Genus','Species','CommonName'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new TextField('Family'),
new TextField('Fieldx1'),
new TextField('Genus'),
new TextField('Hybrid'),
new TextField('Species'),
new TextField('Var'),
new TextField('Infraspecific'),
new TextField('Cultivar'),
new TextField('CultivarGroup'),
new TextField('Synonym'),
new TextField('CommonName'),
new TextField('Continent'),
new TextField('GeoRegion'),
new CheckboxField('Herbarium','In herbarium?'),
new TextField('IUCNCode'),
new ImageField("PlantImage", "Plant Image")
);
}
}
If I remove Genus from the sort it works fine.....
running ss2.3.5 (stable) and DOM,SWFupload, Image_Gallery rev347
any ideas??