Yii Framework Forum: Multimodelform Error On Update Saving - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Multimodelform Error On Update Saving get_class() expects parameter 1 to be object, array given Rate Topic: -----

#1 User is offline   tsuneo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 26-March 13

Posted 26 March 2013 - 05:39 PM

I put down the code as wrote on the extension code, and when I open the update form it shows multiple rows correctly, and it is possible to add new rows as expected.

But when I click on 'Save' button, this error occurs:

Quote

get_class() expects parameter 1 to be object, array given
..\protected\extensions\multimodelform\MultiModelForm.php(457): get_class(array(Telephone, Telephone))


get_class function takes on input an array of two Telephone classes insted of a single Telephone class.

...
public function initItems(&$validatedItems, &$deleteItems, $masterValues = array(), $formData = null)
447     {
448         if (!isset($formData))
449             $formData = $_POST;
450 
451         $result = true;
452         $newItems = array();
453 
454         $validatedItems = array(); //bugfix: 1.0.2
455         $deleteItems = array();
456 
457         [b]$modelClass = get_class($this->model);[/b]
458 
459         if (!isset($formData) || empty($formData[$modelClass]))
460             return true;
...


Someone knows what cause this error?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users