Re: QF3.2 - 2 BC breaks with custom method!
| From: | Alexey Borzov | Date: | Wed, 05 Nov 2003 21:24:24 +0000 |
| Subject: | Re: QF3.2 - 2 BC breaks with custom method! | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8791@lists.php.net to get a copy of this message | ||
Hi!
Ignatius Reilly wrote:
OK. I struggled to upgrade to 3.2 The validation of custom functions seems to suffer at least two BC breaks:Er, when we said that we preserved backwards compatibility, we couldn't imagine all possible clever solutions existing out there. ;] I already wrote something like this in private to Hodicska Gergely who complained about related problems, but I think it wouldn't hurt to repeat this in the list. The problem with your approach is: QuickForm's validation was designed to validate the *value*, not the *element*. If you need additional data to assist this validation, you should pass it in the $format parameter. This can be the element's name, if so needed. If you absolutely need to use the form object itself, do so via global variables or something. Currently neither the RuleRegistry instance, nor Rule instances know anything about the form/element being validated, as they don't need this info. One registry may serve multiple forms, for that matter. You can also look at the new infrastructure and define your own subclass of H_Q_Rule.