ZF-5555: Zend_File_Transfer generates notice, when validating a non-required empty file element

Description

Notice: Undefined index: validated in /var/www/project/library/Zend/File/Transfer/Adapter/Abstract.php on line 578

The code thats seems to generate the error is: if ($content['validated'] === true) {

Comments

Not able to reproduce this behaviour:

The validated key is set at initiation of the HTTP adapter. It is never unset only changed to true and false and always available.

When the validated key is not available then probably something was overwritten or you are using an outdated release.

Please give a reproducable example of your problem.

Hello,

I've reproduce this issue doing this :

  • make a controller in which you set a Zend_Form $form
  • $form should contain an input file ($file)
  • create the view, omitting the input file element ** go to webbrowser an post this form
  • when executed

$form->isValid($post)

the following method produce the message {quote}Notice: Undefined index: validated in /var/www/project/library/Zend/File/Transfer/Adapter/Abstract.php on line 578{quote}

This seems to append when Zend_Form try to validate a non posted input file element. Hope this help.

Updated issue to its original description.

@ Loke; please dont "ruin" an issue next time ;)

@Jérôme: Please note that this issue is marked as "fixed with ZF 1.7.3".

Additionally in the actual release ZF1.8 there is no codeline which reads "if ($content['validated'] === true) {"

Therefor this issue remains as "incomplete"

OK Thomas, thanks.

FYI, my test was made using ZF 1.7.7

Regards.