ZF-6897: Zend_File_Transfer_Adapter_Abstract: Internal file entry created by setDestination() is not seen by _getFiles()

Issue Type: Bug Created: 2009-06-03T16:25:28.000+0000 Last Updated: 2009-06-04T06:00:16.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: dali (dalii) Assignee: Thomas Weidner (thomas) Tags: - Zend_File_Transfer

Related issues: Attachments: - ZF_1.8.2.patch


Bug introduced in r14161

Code to reproduce:

<pre class="highlight">
$adapter = new Zend_File_Transfer_Adapter_Http();

$adapter->setDestination('/tmp', 'some_file');

{panel:bgColor=#FFFFCE|borderStyle=solid} Warning: Exception caught by form: "some_file" not found by file transfer adapter Stack Trace: #0 /ZF/library/Zend/File/Transfer/Adapter/Abstract.php(1033): Zend_File_Transfer_Adapter_Abstract->_getFiles('some_file', false) {panel}

The 'name' attribute is not created by setDestination() however by promoting its verification before the attempt to match the array key first, the file is skipped and never found.


Posted by dali (dalii) on 2009-06-03T16:30:58.000+0000

Proposed patch

Posted by Thomas Weidner (thomas) on 2009-06-03T23:04:41.000+0000

Of course the name attribute is not created. It is given by Zend_Form. And when you want to get something which is not available, throwing an exception is correct.

Posted by Thomas Weidner (thomas) on 2009-06-04T03:07:31.000+0000

Fixed with r15884. Note that your patch introduces a BC break and does not cover unittests. We did therefor not integrate it.

Posted by dali (dalii) on 2009-06-04T06:00:13.000+0000

Thank you.

The patch was based on our understanding of the way access to $this->_files was supposed to be encapsulated. Namely that _getFiles() is the only read accessor but the access rules are more relaxed than that apparently.

So long as the issue is fixed ... ;-)

Keep up the good work!

Have you found an issue?

See the Overview section for more details.


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

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