Yii Framework Forum: An implicit validator - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

An implicit validator Rate Topic: -----

#1 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 27 July 2010 - 10:41 AM

Hi!

I'm trying to add the news from my admin panel, and in my text I have a string $25 thousands.

And then it has been saved I see just thousands. So who's stolen my dollars I dont know :lol:

But if to write $sssdf thousands it saves fine. Cutes only the dollar sight and the digits.

I cant explain with what such behaviour ties. I haven't any filters in my model. I thought it might be problem with ckeditor, but if I disable any javascript and edit my text in simple textarea it made same effect.
0

#2 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 27 July 2010 - 07:51 PM

I know it sounds like a joke
0

#3 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 28 July 2010 - 01:53 AM

Do some debugging. I would start to inspect the POST data (print_r($_POST) never hurts) in the action that saves the values. That should help to identify the source of your problem (client or server).
0

#4 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 28 July 2010 - 06:21 AM

I tested it. In the $_POST is all ok, with dollar sign.
0

#5 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 28 July 2010 - 08:57 AM

Well, then do more debugging. Check

- Attribute values before and after validating
- Parameters bound to your SQL query
0

#6 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 28 July 2010 - 10:44 AM

I'm not sure I use these methods right, but these both showed the same ( with signs ). And about bounding, my rules are:
public function rules()
{
	return array(
		array('title', 'length', 'max'=>128, 'encoding' => 'utf-8'),
	);
}


And it is all, nothing about content field. It is the News table and I have field: title, preview, content and others. If I write $25 in title - all saved normal, but in preview and content not. The title is VARCHAR(128) and preview and content are TEXT .

But I noticed a strange thing. If I write: $25 doll $255 doll $2555 doll, after saving it will: doll 5 doll 55 doll. And the only one thought washed over me is RegExps. But what they are doing here.

I don't know something I seems...
0

#7 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 29 July 2010 - 01:15 AM

Hey, thanks for pointing me to the new encoding parameter. I've totally missed this :). Just added that information to the unicode cookbook.


About your problem: So did you compare the model values at different places? Otherwise it's hard to find the problematic component. What parameters are logged with your SQL statement?
0

#8 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 29 July 2010 - 02:23 AM

I myself just knew about it parameter, without this I took a wrong string length)

And about this problem. I little fucked up, it's not in the saving stage, it's in the output stage. It's bacause of contentCompactor extension and I was wondered when knew it :( I don't know any details how it turned out, but I just turn it off and all display good. Thanks anyway :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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