-- Arthur M. Kang <[EMAIL PROTECTED]> wrote
(on Thursday, 04 September 2008, 09:37 AM -0700):
> After upgrading to ZF 1.6, some of my Form->Select elements started having
> validation errors of 'value was not found in the haystack'.
> 
> Firstly, I have not added any validators to these elements, so I don't know if
> it is a new feature of the framework to automatically add the InArray 
> validator
> to certain elements.

Yes, this is a new feature -- auto-registration of an InArray validator
that uses the keys of the multiOptions registered with the element.

You can disable this with one of the following:

   // using the element instance:
   $element->setRegisterInArrayValidator(false);

   // or a configuration key:
   'registerInArrayValidator' => false
   element.options.registerInArrayValidator = false

> Secondly, and more importantly, the select element is using a 
> multi-dimensional
> which automatically creates OPTGROUP tags as headers within the selection.  It
> looks like InArray is only checking against the first level of the array and
> does not check recursively.  Since these OPTGROUP values are not selectable,
> the element will always fail validation.

Right. This is a much more difficult validation to achieve, and we can
hopefully address it for a coming release. In the meantime, simply don't
register the validator, using the instructions above.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to