Re: Weird saveField error, UPDATE value gets ...distorted?!

2008-12-16 Thread Alexandru Ciobanu
Snoopaki wrote: I found the error, it was on my behalf (as usual). I had a beforeSave() function in my model that replaced the $this- model-data['file'] value with the tmp_name value of the form. I was not aware that saveField() used $this-model-data['FieldName'] to store its

Weird saveField error, UPDATE value gets ...distorted?!

2008-12-15 Thread Snoopaki
Hello, After performing a save() on a file form, I use the last inserted ID ( $this-Model-id ) to create a correct $filename ( my moveUploadedFile() returns the correct $filename ) and then I try to update the 'file' field via $this-Model-saveField( 'file' , $filename ). The query runs fine and

Re: Weird saveField error, UPDATE value gets ...distorted?!

2008-12-15 Thread Snoopaki
MySQL Field Type is varchar(255) in case someone is wondering ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from

Re: Weird saveField error, UPDATE value gets ...distorted?!

2008-12-15 Thread Alexandru Ciobanu
Snoopaki wrote: The first letter of the variable $filename, in my case, as my webserver is in C:\wamp\ , it updates the value to just 'C' \ escapes the rest... e.g. C:\\wamp\\ = first \ escapes the second one, so only the last one gets printed. Please paste your

Re: Weird saveField error, UPDATE value gets ...distorted?!

2008-12-15 Thread Snoopaki
I actually have it like this: $filename = $this-Banner- moveUploadedFile( $this-Banner-id , $data['file']['type'] , $data ['file']['tmp_name'] ) and the function in the model class is: function moveUploadedFile( $id , $mime_type , $path ) { $extension =

Re: Weird saveField error, UPDATE value gets ...distorted?!

2008-12-15 Thread Snoopaki
I tried using cakephp's Sanitize::clean function before I call the saveField but the result is the same :/ $filename = Sanitize::clean( $filename ); The debug($filename) result is different (sanitized) of course.. debug($filename) :

Re: Weird saveField error, UPDATE value gets ...distorted?!

2008-12-15 Thread Snoopaki
I found the error, it was on my behalf (as usual). I had a beforeSave() function in my model that replaced the $this- model-data['file'] value with the tmp_name value of the form. I was not aware that saveField() used $this-model-data['FieldName'] to store its value. I suppose it simply runs a