else{
$form = $this->_getAddForm($this->model,null,array('user_fields'=>$this->fields()));
$this->_setupAddForm($form);
- $this->setInlines($this->model, null);
+ $data = array();
+ $this->setInlines($this->model, &$data);
}
$context = array(
'page_title'=>'Add '.$this->modelName,
function save($commit=true)
{
if ($this->isValid()) {
-
- //print_r($this->cleaned_data);
-
- //print ($this->cleaned_data['category']);
-
$this->model->SetFromFormData($this->cleaned_data);
-
- //print_r($this->model->data);
- /*
- if ($commit && $this->model->id) {
- $this->model->update();
- } elseif ($commit) {
- $this->model->create();
- }
- */
-
try{
$this->model->save();
return $this->model;
$erecords = $e->getInvalidRecords();
$errors = $erecords[0]->getErrorStack();
foreach($errors as $k=>$v){
- print($v);
+ print($k);
}
}
}