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">
<legend align= "center"><?php echo CHtml::image(Yii::app()->baseUrl.'/images/escribir_comentario.jpg'); ?></legend>
<div class="yiiForm">
<?php echo CHtml::beginForm(); ?>
<?php echo CHtml::errorSummary($comentario); ?>
<div class="simple">
<strong><?php echo CHtml::activeLabel($comentario,'autor'); ?></strong>
<?php echo CHtml::activeTextField($comentario,'autor'); ?>
</div>
<div class="simple">
<strong><?php echo CHtml::activeLabel($comentario,'texto'); ?></strong>
<?php echo CHtml::activeTextArea($comentario,'texto',array('rows'=>5, 'cols'=>35)); ?>
</div>
<?php if(extension_loaded('gd')): ?>
<div class="simple" >
<strong><?php echo CHtml::activeLabel($comentario,'verifyCode'); ?></strong>
<?php echo CHtml::activeTextField($comentario,'verifyCode',array('size'=>10,'maxlength'=>10)); ?>
</div>
<?php $this->widget('CCaptcha'); ?>
<?php endif; ?>
<div class="action">
<?php echo CHtml::submitButton($update ? 'Save' : 'Enviar', array('name'=>'submitComment')); ?>
</div>
<?php echo CHtml::endForm(); ?>
</div><!-- form -->
</fieldset>
Thanks