cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[Bug]Phalcon\Mvc\Model::_postSaveRelatedRecords(): Call to method getmessages() on a non object in ... PollController.php

Open jarvischen opened this issue 13 years ago • 1 comments

Using: $poll = new Poll(); $poll->name = $this->request->getPost("name", "string"); $poll->start_time = strtotime("2013-03-18"); $poll->end_time = strtotime("2013-03-20");

$options[0] = new Option(); //$options[0]->name = "Option 1";

$options[1] = new Option(); //$options[1]->name = "Option 2";

$poll->options = $options; $poll->save();

foreach($poll->getMessages() as $message){ echo $message,"
"; }

I get PhalconException: Phalcon\Mvc\Model::_postSaveRelatedRecords(): Call to method getmessages() on a non object in web/apps/frontend/controllers/PollController.php

Expected result is: name is required (option model)

jarvischen avatar Mar 20 '13 09:03 jarvischen

This is fixed in the 1.0.0 branch, thanks

ghost avatar Mar 21 '13 04:03 ghost