As reply to an mail this has been sent on 15.Oct:
-----------------------------
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: "drj201" <[EMAIL PROTECTED]>
To: <fw-general@lists.zend.com>
Sent: Monday, October 20, 2008 1:21 PM
Subject: [fw-general] Problems with Zend_Form_Element_File since ZF1.6.2



I am trying to add a Zend_Form_Element File to a form... I am extending
Zend_Form with my own class for reuse purposes. The problem is that since
upgrading to ZF 1.6.2 my code no longer works.

Build element:

$this->addElement('file', 'logo', array(
           'label' => 'Logo',
...etc
       ));

Add to form using group decorator:

$this->addDisplayGroup(
           array('logo'), 'logodata',
           array(
               'legend' => 'Dealer Logo'
           )
       );

This results in the following error:

Warning: Exception caught by form: Unknown file Stack Trace: #0
demoapp/lib/Zend/Form/Element/File.php(357):
Zend_File_Transfer_Adapter_Abstract->getFilters('logo') #1
demoapp/lib/Zend/Form/Element.php(524): Zend_Form_Element_File->getFilters()
#2 demoapp/lib/Zend/Form/Element.php(541):
Zend_Form_Element->_filterValue(NULL, NULL) #3
demoapp/lib/Zend/Form/Decorator/ViewHelper.php(201):
Zend_Form_Element->getValue() #4
demoapp/lib/Zend/Form/Decorator/ViewHelper.php(231):
Zend_Form_Decorator_ViewHelper->getValue(Object(Zend_Form_Element_File)) #5
demoapp/lib/Zend/Form/Element.php(1905):
Zend_Form_Decorator_ViewHelper->render('') #6
demoapp/lib/Zend/Form/Decorator/FormElements.php(100):
Zend_Form_Element->render() #7 demoapp/lib/Zend/Form.php(2596):
Zend_Form_Decorator_FormElements->render('') #8 /Applicat in
demoapp/lib/Zend/Form.php on line 2616


Using the following manual approach works fine:

$element = new Zend_Form_Element_File('foo');
$element->setLabel('Upload an image:')
...etc

Any reason this has happened since upgrading to 1.6.2?

Thanks,
David
--
View this message in context: http://www.nabble.com/Problems-with-Zend_Form_Element_File-since-ZF1.6.2-tp20067249p20067249.html Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to