Hello all,

I'm having some issues with a custom validator class and I've been
absolutely tearing my hair out with this one.  Here's the situation:

I want to do something like sfValidatorFile which additionally also uses the
gd image libraries to validate the dimensions of the image.  To make testing
faster, I decided to simply copy sfValidatorFile.class.php into my lib/form
directory and rename the file (and the class) to gabeValidatorImage.  I call
this from my form and there are no errors about missing classes, so I know
this is being detected.

The form has three image upload widgets.  Again, for the purpose of my
testing, I left two of them to use the original sfValidatorFile validator
and switched one to use the new (and *identical, *except for the name and
the path) gabeValidatorImage.

When I submit the form with three files, the two using the original
validator get their filenames saved to my database, but the custom one won't
save.  I can also see that the file is not in my uploads directory (based on
file sizes of the files I'm using to test with).  The fields are not-null,
so a blank string is getting saved instead.

I thought surely I must have goofed up in the form definition, so I switched
the validator back to the original and of course, now all three names get
saved.  So I diffed the two validators:  only the class names have changed.
 I went as far as to rename the class to sfValidatorImage and move it to
lib/vendor/symfony/lib/validator and then add it to the array in
coreAutoLoad.  It STILL didn't work.

I just spent the last hour step-through debugging with netbeans, to no
avail.

Can someone please explain the magic going on here to me?  I can't imagine
any reason why this wouldn't work.

Thanks very much!

-Gabriel Comeau

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to