Yes, this issue was added 7 hours ago and have already been fixed in trunk and branch.
To solve this shortly you can:

* Do not use addElement on the file element... the reason is that getValue() will be called on the file elements but they have no value and behave false in such a condition
or
* Add a empty rename filter by setting source and target the same value

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "SiCo007" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, October 14, 2008 8:59 PM
Subject: [fw-general] Problem with Zend_Form File Element



I wonder if anyone can confirm this for me, I create my file element with
array notation rather than instantiating, setting the options and passing
the created element to Zend_Form. Since I upgraded to 1.6.2 this morning my
file elements have stopped working with the following errors:

Notice: Undefined index: filters in
C:\www\enginepumps\www\lib\Zend\File\Transfer\Adapter\Abstract.php on line
796
Fatal error: Unsupported operand types in
C:\www\enginepumps\www\lib\Zend\File\Transfer\Adapter\Abstract.php on line
796

This is becuase I don't set any filters... However when creating the element
by instantiating the actual form file element it works perfectly.

This is creating a very simple file element. $this->_moveTo is a valid
directory on the file system.
$this->addElement('file', 'image', array(
'destination' => $this->_moveTo,
));

Doing the same like so works perfectly:
$element = new Zend_Form_Element_File('image');
->setDestination($this->_moveTo);

Can anyone confirm this?

-----
Simon

http://www.ajb007.co.uk/
--
View this message in context: http://www.nabble.com/Problem-with-Zend_Form-File-Element-tp19979955p19979955.html Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to