validators:email = true... not working

A place for users and developers of the Xataface to discuss and receive support.

validators:email = true... not working

Postby Cabeza » Sun Sep 16, 2012 12:53 pm

Steve,
I set on fields.ini of the corresponding table:
[email]
validators:email = true
validators:regex:message = ...

And now there is no way to go past the field, regardless of the input format.

I see (on the apache error.log)
PHP Warning: preg_match(): Empty regular expression in /Library/WebServer/Documents/xataface/lib/HTML/QuickForm/Rule/Regex.php on line 61, referer: http://localhost/.../index.php

I tried to do some tracing and it appears that effectively $regex is empty when testing if (!preg_match($regex, $value)...but after hours of trying I can't pinpoint where in the chain of calls to validate() the thing is lost :cry: .
Any suggestions?

Thanks!
Cabeza
 
Posts: 31
Joined: Mon Sep 03, 2012 10:25 am

Re: validators:email = true... not working

Postby shannah » Mon Sep 17, 2012 8:55 am

validators:regex:message should always accompany a validators:regex directive. Otherwise you'll get this error when it tries to compile a null regex.

Perhaps you mean validators:email:message ?

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: validators:email = true... not working[SOLVED]

Postby Cabeza » Mon Sep 17, 2012 9:59 am

Oh my! I knew it had to be something stupid, and there you are.

You are right, I was trying with validatiors:regex:message instead of ...:email:... Oh well.
(I have to say, I did learn a lot about the HTML_QuickForm implementation of regexp on the way :-) )
(Which reminds me: preg_match() is able to gobble up Perl's '/\p{L}/' for Unicode letters no problem. But it appears to be no go using validators:regex: Any idea way?
I could not make it work to check unicode strings, and ended up using
validators:regex = '/^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ]+$/' which we will all agree is not as elegant... :roll:

Thanks once more (and it will not be the last).

BTW - thanks for the clean implementation of widget:atts:... it allowed me to incorporate the opentip (http://www.opentip.org) framework pain-less-ly. You are good.
Cheers.
Cabeza
 
Posts: 31
Joined: Mon Sep 03, 2012 10:25 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 11 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved