Yii Framework Forum: No Error Message In Cunsafevalidator - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

No Error Message In Cunsafevalidator Rate Topic: -----

#1 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,369
  • Joined: 21-February 11
  • Location:Greece

Posted 15 July 2013 - 03:27 AM

Hi

accodring to conversation on this post

http://www.yiiframew...post__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?
Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 554
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 15 July 2013 - 06:34 AM

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

#3 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,369
  • Joined: 21-February 11
  • Location:Greece

Posted 15 July 2013 - 07:33 AM

View PostCeBe, on 15 July 2013 - 06:34 AM, said:

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)
	{
	}

Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#4 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 554
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 15 July 2013 - 01:29 PM

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

http://www.yiiframew...alidation-rules
0

#5 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,369
  • Joined: 21-February 11
  • Location:Greece

Posted 16 July 2013 - 04:36 AM

View PostCeBe, on 15 July 2013 - 01:29 PM, said:

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

http://www.yiiframew...alidation-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
Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#6 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 554
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 16 July 2013 - 06:29 AM

Got it. Changed the documentation: 27d65f50f9f1b76581cf03d3bce362cbd58f48ef

Thanks for reporting.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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