Issues

ZF-4595: Zend_Form_Element_File blows up when not using filters

Issue Type: Bug Created: 2008-10-14T05:49:55.000+0000 Last Updated: 2008-11-13T14:10:11.000+0000 Status: Resolved Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Colin Seaman (colinseaman) Assignee: Thomas Weidner (thomas) Tags: - Zend_Form

Related issues: Attachments:

Description

Just hooked up 1.6.2 o my existing app and file uploading seems to blow up when using Zend_Form_Element_File.

The error message is:

Notice: Undefined index: filters in /home/colinseaman/ZendFramework-1.6.2/library/Zend/File/Transfer/Adapter/Abstract.php on line 796

Fatal error: Unsupported operand types in /home/colinseaman/ZendFramework-1.6.2/library/Zend/File/Transfer/Adapter/Abstract.php on line 796

Here's my code. I'm not rendering the form using the default Zend_Form layout, instead I'm passing the elements to a view and echo'ing them out one by one. My view script is underneath.

class forms_testForm extends Zend_Form {

public function __construct() {

    $uploadPath = Application::instance()->getUploadpaths('profile');    
    $image1 = new Zend_Form_Element_File('image1');
    $image1->setLabel('Upload an image:')
                    ->setRequired(false)
                    ->setDestination($uploadPath)
                    ->addValidator('Count', true, 1)     // ensure only 1 file        
                    ->addValidator('Size', true, 102400) // limit to 100K        
                    ->addValidator('Extension', true, 'jpg,png,gif'); 

    $submit = new Zend_Form_Element_Submit('upload');
    $submit->setLabel('Upload');



    $this->addElements(array($image1, $submit));


}

}

// View Script

Upload a photo for your profile' form->image1 ?> form->upload ?> This worked fine with 1.6.1. Have tested this with 1.7PR1 but same error

Comments

Posted by Thomas Weidner (thomas) on 2008-10-14T11:30:01.000+0000

This has already been fixed on trunk. But due to code freeze this fix is not in the Sanity Check Packages

Posted by Thomas Weidner (thomas) on 2008-10-14T12:42:49.000+0000

Fixed in both releases

Posted by Wil Sinclair (wil) on 2008-11-13T14:10:11.000+0000

Changing issues in preparation for the 1.7.0 release.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts