From 93788a8b39895421293ce2fb97d2c5fb58d2af99 Mon Sep 17 00:00:00 2001 From: avl Date: Fri, 12 Sep 2008 20:14:30 +0300 Subject: [PATCH] Fix reference adminmodel bug --- ipf/admin/model.php | 3 ++- ipf/form/model.php | 17 +---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/ipf/admin/model.php b/ipf/admin/model.php index 394ef50..b4b81c3 100644 --- a/ipf/admin/model.php +++ b/ipf/admin/model.php @@ -181,7 +181,8 @@ class IPF_Admin_Model{ 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, diff --git a/ipf/form/model.php b/ipf/form/model.php index 4d77b66..295a69e 100644 --- a/ipf/form/model.php +++ b/ipf/form/model.php @@ -102,22 +102,7 @@ class IPF_Form_Model extends IPF_Form 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; @@ -125,7 +110,7 @@ class IPF_Form_Model extends IPF_Form $erecords = $e->getInvalidRecords(); $errors = $erecords[0]->getErrorStack(); foreach($errors as $k=>$v){ - print($v); + print($k); } } } -- 2.49.0