Issues

ZF-7851: Call to Zend_Form_Element::receive() and then Zend_Form::getValues causes Zend_Validate_File_Count to count 2 files

Issue Type:

Bug

Created:

2009-09-15T16:18:47.000+0000

Last Updated:

2009-09-27T01:18:50.000+0000

Status:

Resolved

Fix version(s):

1.10.0 (27/Jan/10)

Reporter:

Duo Zheng (duoduo)

Assignee:

Thomas Weidner (thomas)

Tags:

Zend_Form

Zend_Validate_File

Related issues:

Attachments:

Description

Zend_Validate_File_Count shows an error prematurely like this:
"Too much files, maximum '1' are allowed but '2' are given"

This can be done in 2 ways

Call Zend_Form_Element::receive() then call Zend_Form->getValues()

Call Zend_Form->getValues twice

What happens is the first call adds the temporary file path to Zend_Validate_File_Count
/tmp/phpwlAZqc

The second call adds the real file name
/tmp/picture.jpg

I do understand that getValues tries to process the form, but should I not be able to call it twice on the same instance? Or sometimes you want to check of the file was received first with Zend_Form_Element::receive() then collect the form data with Zend_Form->getValues(). If it shouldn't something should be done about multiple calls. Took a while to track this down.