ZF-1859: allowEmpty = false is ineffective if input rule has multiple fields

Description

Issue reported by Jim Scherer.

Below is code to demonstrate the failure:


<?php

require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();

$filters = array( );

$validators = array(
    'test' => array(
        'allowEmpty' => false,
        'fields' => array( 'empty', 'notempty' )
    )
);

$data = array(
    'empty' => '',
    'notempty' => 'not empty'
);

$input = new Zend_Filter_Input( $filters, $validators, $data );

// expect input to be invalid
echo "\ninput->isValid =\n";
var_dump($input->isValid());

echo "\nvalidators =\n";
var_dump($validators);

// echo "\ninput object =\n";
// echo var_dump($input);

echo "\nempty(data[empty]) =\n";
var_dump(empty($data['empty']));

echo "\nempty(data[notempty]) =\n";
var_dump(empty($data['notempty']));

Comments

Confirmed that {{isValid()}} returns {{true}}, which is wrong for the example case above.

Changing to 'Unassigned'

This issue should have been fixed for the 1.5 release.

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Please evaluate and categorize/assign as necessary.

I will spend some time on it later this week.

Running the above code on actual trunk I get the expected and wished result. Closing this issue as fixed for the next release as I'm unsure when it was really fixed.