Zend Framework

Undefined variable: result in Zend_File_Transfer_Adapter_Abstract

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Duplicate
  • Affects Version/s: 1.6.2
  • Fix Version/s: 1.6.2
  • Component/s: Zend_File_Transfer
  • Labels:
    None

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

Activity

Hide
Thomas Weidner added a comment -

Duplication of already fixed issue

Show
Thomas Weidner added a comment - Duplication of already fixed issue
Hide
Taylor Ettema added a comment -

How is this fixed? I just downloaded 1.6.2, and it's still there....

Show
Taylor Ettema added a comment - How is this fixed? I just downloaded 1.6.2, and it's still there....
Hide
Taylor Ettema added a comment -

Just to be precise - the warning is thrown out of getFilters when I came across it in 1.6.2

Show
Taylor Ettema added a comment - Just to be precise - the warning is thrown out of getFilters when I came across it in 1.6.2
Hide
Thomas Weidner added a comment -

As mentioned already fixed with r11906

Show
Thomas Weidner added a comment - As mentioned already fixed with r11906
Hide
Michel Vanhamme added a comment -

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...

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

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.

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

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

Show
Michel Vanhamme added a comment - 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
Hide
Taylor Ettema added a comment -

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.

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

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.

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

In your attached example, based on the call of clearFilters I found a possible problem.

It's fixed with r12055.

Still to mention:

  • Please use the correct component... when a failure is thrown by usage of Zend_Form then attach this component and not another
  • Please add ALWAYS your used php and ZF version
  • Please add reproducabel code... without it it's nearly impossible to help when file uploads are done
Show
Thomas Weidner added a comment - In your attached example, based on the call of clearFilters I found a possible problem. It's fixed with r12055. Still to mention:
  • Please use the correct component... when a failure is thrown by usage of Zend_Form then attach this component and not another
  • Please add ALWAYS your used php and ZF version
  • Please add reproducabel code... without it it's nearly impossible to help when file uploads are done
Hide
Michel Vanhamme added a comment -

Please use the correct component... when a failure is thrown by usage of Zend_Form then attach this component and not another

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.

Show
Michel Vanhamme added a comment -
Please use the correct component... when a failure is thrown by usage of Zend_Form then attach this component and not another
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.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: