Zend Framework

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

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.2
  • Fix Version/s: 1.9.0
  • Component/s: Zend_File_Transfer
  • Labels:
    None

Description

Bug introduced in r14161

Code to reproduce:

$adapter = new Zend_File_Transfer_Adapter_Http();

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

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)

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.

Activity

Hide
dali added a comment -

Proposed patch

Show
dali added a comment - Proposed patch
Hide
Thomas Weidner added a comment -

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.

Show
Thomas Weidner added a comment - 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.
Hide
Thomas Weidner added a comment -

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

Show
Thomas Weidner added a comment - Fixed with r15884. Note that your patch introduces a BC break and does not cover unittests. We did therefor not integrate it.
Hide
dali added a comment -

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!

Show
dali added a comment - 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!

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: