Page 1 of 1

Custom validation issue

PostPosted: Thu Jul 05, 2012 2:00 am
by loljak
Hi,

I'm relatively new to Xataface, and I think this is a great app which give you the ability of building in a quick way something you can give to your client, this is a nice base for further development.

I need to validate a date field, I have written a simple test in the delegate class, using the name_of field__validate method. I have tested this function with Xdebug using breakpoints and step by step for walking in my code. It returns true if the date is valid (Posterior to the last record) and false if not... That is quite simple, but when I run the app I can't validate the forms without an occurring error ... I've got no apache error, and no more information about this except 'Erreurs' (I'm French...) in the error reporting block. Without my validate function, the same new record is OK...

All the variables shown by Xdebug seems me to be coherent. And I don't alter one of the values passed by reference..

I'm running last xataface version in a Lamp context (Debian squeeze, PHP 5.3).

Is anybody have an idea of what I'm missing?

Thanks for your help.

Re: Custom validation issue

PostPosted: Fri Jul 06, 2012 12:25 am
by loljak
I have solved the problem, but I don't understand really why. I have a mysql query in the function, and if I test the return with
Code: Select all
if (!$result)
I've got trouble, and the function allways return false. with
Code: Select all
if (!is_resource)
all is working fine...

Sounds like if the validate function is executed twice...

Re: Custom validation issue

PostPosted: Fri Jul 06, 2012 10:06 am
by shannah
If you can show me the source code, I may be able to tell you why.