ZF-4639: Undefined variable: result in Zend_File_Transfer_Adapter_Abstract
Description
In Zend_File_Transfer_Adapater_Abstract an warning is raised in getFilters().
Notice: Undefined variable: result in library\Zend\File\Transfer\Adapter\Abstract.php on line 809
Fix: $result = array() on top of the last foreach loop
Comments
Posted by Thomas Weidner (thomas) on 2008-10-19T11:50:56.000+0000
Duplication of already fixed issue
Posted by Taylor Ettema (tettema) on 2008-10-19T21:47:26.000+0000
How is this fixed? I just downloaded 1.6.2, and it's still there....
Posted by Taylor Ettema (tettema) on 2008-10-19T21:50:02.000+0000
Just to be precise - the warning is thrown out of getFilters when I came across it in 1.6.2
Posted by Thomas Weidner (thomas) on 2008-10-20T03:09:13.000+0000
As mentioned already fixed with r11906
Posted by Michel Vanhamme (michel) on 2008-10-21T02:04:07.000+0000
Maybe I'm looking in the wrong place, but... Looking at both r11906 and the 1.6.2 release, I see the fix in the getValidators function, but not in the getFilters function...
Posted by Thomas Weidner (thomas) on 2008-10-21T02:30:16.000+0000
Then please give php version and reproducable code... unittests are not showing problems, and also when calling getFilters I see no failure message at all.
Posted by Michel Vanhamme (michel) on 2008-10-21T07:56:05.000+0000
Thomas, here is a snippet of code that throws the error. Hope this helps.
PHP 5.2.0 ZF 1.6.2
Running the attached script throws the following in Zend_File_Transfer_Adapter_Abstract on my machine:
PHP Notice: Undefined variable: result in /Users/michel/web-lib/ZendFramework-1.6.2-minimal/library/Zend/File/Transfer/Adapter/Abstract.php on line 803 PHP Warning: Invalid argument supplied for foreach() in /Users/michel/web-lib/ZendFramework-1.6.2-minimal/library/Zend/Form/Element.php on line 524
Posted by Taylor Ettema (tettema) on 2008-10-21T08:17:28.000+0000
I also still see an issue with a Zend Form with a File element, as soon as I call form->getData (or whatever it is), it throws that warning.
Posted by Thomas Weidner (thomas) on 2008-10-21T10:05:36.000+0000
Sorry, but Zend_Form is not Zend_File_Translate... These are 2 different components from different authors.
When you having problems with getData please open a issue with Zend_Form as component and not Zend_File_Transfer.
Posted by Thomas Weidner (thomas) on 2008-10-21T10:12:09.000+0000
In your attached example, based on the call of clearFilters I found a possible problem.
It's fixed with r12055.
Still to mention:
Posted by Michel Vanhamme (michel) on 2008-10-22T00:49:29.000+0000
{quote} Please use the correct component... when a failure is thrown by usage of Zend_Form then attach this component and not another {quote}
My apologies. I thought it had to be the component that throws the error. I'll keep this, and your other remarks, in mind for the future.