No Error Message In Cunsafevalidator

Hi

accodring to conversation on this post

http://www.yiiframework.com/forum/index.php/topic/45115-unsafe-attributes-logged-but-no-errors/page__view__findpost__p__213603

I checked the code 32-34 lines of framework/validators/CUnsafeValidator


protected function validateAttribute($object,$attribute)

	{

	}

there is no code like $this->addError($object,$attribute,$message,…) to add an error

Is it a bug?

Why should CUnsafeValidator add Error to model? It just marks attribute unsafe for mass assignment.

Based on the conversation with @ardetrick and according to the comment-guide of kernel Yii file the below could be confuse a lot of members


         /**

	 * Validates the attribute of the object.

	 * --> If there is any error, the error message is added to the object.

	 * @param CModel $object the object being validated

	 * @param string $attribute the attribute being validated

	 */

	protected function validateAttribute($object,$attribute)

	{

	}

I suggest you to read the following wiki article to understand what safe validator is used for:

http://www.yiiframework.com/wiki/161/understanding-safe-validation-rules

Hi Cebe

I have already understand the using of safe and unsafe validator. I just highlight the comments-guid of Yii kernel file


//--> If there is any error, the error message is added to the object.

Sincerely

Got it. Changed the documentation: 27d65f50f9f1b76581cf03d3bce362cbd58f48ef

Thanks for reporting.