Hi,

the check for a required parameter currently throws the general error  
message in any case, there is no way to distinguish a 'you need to  
specify this parameter' from the 'oops, something wrong with that  
parameter'. The relevant code snippet is in AgaviValidator.class.php

                                if($this->getParameter('required', true)) {
                                        $this->throwError();
                                        $result = $errorCode;
                                } else {
                                        // we don't throw an error here because 
this is not an incident  
per se
                                        // but rather a non validated field
                                        $result = self::NOT_PROCESSED;
                                }

I think this should specify something like

                                if($this->getParameter('required', true)) {
                                        $this->throwError('required');
                                        $result = $errorCode;
                                } else {
                                        // we don't throw an error here because 
this is not an incident  
per se
                                        // but rather a non validated field
                                        $result = self::NOT_PROCESSED;
                                }

so that users can set a specific error message. That's a minor change  
and keeps BC, so I hope to see that. Any thoughts on that? Should I  
open a ticket?

cheers.

felix


_______________________________________________
Agavi Dev Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/dev

Reply via email to