NULL field after model->save()

Hi :

We’ve updated our project to new version of yii 1.1

On comment insert everything works fine, except the content of the comment is NULL, before the update this action works fine.

This is my funtion

protected function newComentario($articulo)

{


	$comentario=new comentario;


	if(isset($_POST['comentario']))


	{


		$comentario->attributes=$_POST['comentario'];


		$comentario->articulo_id=$articulo->id;


		$comentario->created_at=date('Y-m-d h:i:s');


		


	}


	if(isset($_POST['submitComment']) && $comentario->save())


		{


				Yii::app()->user->setFlash('commentSubmitted','Thank you for your comment. Your comment will be posted once it is approved.');


				$this->refresh();


			


		}


	return $comentario;

And the form:

<fieldset id="comentario_form">

&lt;legend align= &quot;center&quot;&gt;&lt;?php echo CHtml::image(Yii::app()-&gt;baseUrl.'/images/escribir_comentario.jpg'); ?&gt;&lt;/legend&gt;

<div class="yiiForm">

&lt;?php echo CHtml::beginForm(); ?&gt;





&lt;?php echo CHtml::errorSummary(&#036;comentario); ?&gt;





&lt;div class=&quot;simple&quot;&gt;


&lt;strong&gt;&lt;?php echo CHtml::activeLabel(&#036;comentario,'autor'); ?&gt;&lt;/strong&gt;


&lt;?php echo CHtml::activeTextField(&#036;comentario,'autor'); ?&gt;


&lt;/div&gt;


&lt;div class=&quot;simple&quot;&gt;


&lt;strong&gt;&lt;?php echo CHtml::activeLabel(&#036;comentario,'texto'); ?&gt;&lt;/strong&gt;


&lt;?php echo CHtml::activeTextArea(&#036;comentario,'texto',array('rows'=&gt;5, 'cols'=&gt;35)); ?&gt;


&lt;/div&gt;





&lt;?php if(extension_loaded('gd')): ?&gt;


&lt;div class=&quot;simple&quot; &gt;


	&lt;strong&gt;&lt;?php echo CHtml::activeLabel(&#036;comentario,'verifyCode'); ?&gt;&lt;/strong&gt;


	&lt;?php echo CHtml::activeTextField(&#036;comentario,'verifyCode',array('size'=&gt;10,'maxlength'=&gt;10)); ?&gt;


&lt;/div&gt;


&lt;?php &#036;this-&gt;widget('CCaptcha'); ?&gt;


&lt;?php endif; ?&gt;





&lt;div class=&quot;action&quot;&gt;


	&lt;?php echo CHtml::submitButton(&#036;update ? 'Save' : 'Enviar', array('name'=&gt;'submitComment')); ?&gt;	


&lt;/div&gt;





&lt;?php echo CHtml::endForm(); ?&gt;

</div><!-- form -->

</fieldset>

Thanks

Read up on safe attributes, the way they work has changed from 1.0 to 1.1 and you probably don’t have a rule set for your comment property.

Also, please format your code with [php] tags, makes it so much easier to read. Thanks.