ZF-8335: Bug with required select field in array notation

Issue Type: Sub-task Created: 2009-11-19T03:31:15.000+0000 Last Updated: 2010-04-16T12:53:50.000+0000 Status: Resolved Fix version(s): Reporter: seba kerckhof (seba) Assignee: Christian Albrecht (alab) Tags: - Zend_Form

Related issues: Attachments:



I believe I found a bug, it could be me doing something wrong, but I can't find much information about it:

I have a form with select elements that use the 'belongsto' property and are required. It keeps telling me the selected values are empty, while they're not.

Complete description:

I have a form that extends Zend_Form, in the init I add some elements to the form. I added two select fields, that I want in array notation:

<pre class="highlight">
            'label' =>  'Instructor:',
            'required' => true,
            'belongsTo' => 'obligated'));
            'label' =>'Pilot:',
            'required' => true,
            'belongsTo' => 'obligated'));
        $this->addDisplayGroup(array('instructor','pilot'), 'reservation',array('order'=>25));

(userselect is a custom element, it's just a subclass of Zend_Form_Element_Select that adds all registered users)

This renders correctly as:

<pre class="highlight">
Testuser 1Testuser 2 
Testuser 1Testuser 2

Now, if I want to submit the form, it keeps telling me: {quote}Value is required and can't be empty{quote} on both elements, while this obviously isn't the case...


Posted by Christian Albrecht (alab) on 2010-03-25T13:24:00.000+0000

Will work on belongsTo when finished elementsBelongTo.

Posted by Christian Albrecht (alab) on 2010-04-16T12:53:50.000+0000

Applied patch and Unit Test to parent Issue ZF-9607

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.