]> git.andy128k.dev Git - ipf.git/commitdiff
Fix reference adminmodel bug
authoravl <alex.litovchenko@gmail.com>
Fri, 12 Sep 2008 17:14:30 +0000 (20:14 +0300)
committeravl <alex.litovchenko@gmail.com>
Fri, 12 Sep 2008 17:14:30 +0000 (20:14 +0300)
ipf/admin/model.php
ipf/form/model.php

index 394ef5071f57f1344b8e46a8bacef8a6956d9390..b4b81c3e6f1764bc20a9088d7722e6a42a67412b 100644 (file)
@@ -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, 
index 4d77b66c7616917d05c4d7092cd86e90f01a53b1..295a69e5ba38b73a674d4167d3ead563bfdc1c09 100644 (file)
@@ -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);
                 }
             }
         }