Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Not an Issue
-
Affects Version/s: 1.10.6
-
Fix Version/s: 1.10.7
-
Component/s: Zend_File_Transfer
-
Labels:None
Description
Zend_File_Transfer_Adapter_Http::getProgress() doesn't work well in combination with "PECL uploadprogress", because the $_GET value "progress_key" is never set by this module.
The point is, that you have to set the value manually to make it work:
//WORKS AS EXPECTED:
$x = uploadprogress_get_info($parUploadId);
//MANUALLY ADD TO MAKE IT WORK:
$_GET['progress_key'] = $parUploadId;
require_once 'Zend/ProgressBar/Adapter/JsPush.php';
$adapter = new Zend_ProgressBar_Adapter_JsPush();
//ALWAYS RETURNS null WITHOUT THE CORRECTION ABOVE:
$upload = Zend_File_Transfer_Adapter_Http::getProgress();
$upload = null;
while (!$upload['done']) {
//ALWAYS RETURNS null WITHOUT THE CORRECTION ABOVE:
$upload = Zend_File_Transfer_Adapter_Http::getProgress($upload);
var_dump($upload);
}
Furthermore you should please add some documentation which hidden fields (and in which order) should be contained in the form, not only mention that Zend_Form adds it automatically. Not everyone uses it!
Please fix this issue so that the described workaround is no more needed. Without this hack the module never works.
The manual of uploadprogress notes which hidden fields have to be set.
Additionally there is an full example within the ZF demo section which shows how to use this external module manually within ZF.
The ZF manual itself is witten to be used with Zend_Form.
Still it notes:
Second, you need to have the proper hidden fields added in the form which sends the files. When you use Zend_Form_Element_File this hidden fields are automatically added by Zend_Form.This is no hack... Zend_Form adds this form fields automatically and you are not using Zend_Form. How should Zend_File_Transfer add form fields? Your intention is in my eyes unlogically.
Which hidden fields you have to add belongs on the used extension and it's version as also on the used settings for this extension.
Second, you need to have the proper hidden fields added in the form which sends the files. When you use Zend_Form_Element_File this hidden fields are automatically added by Zend_Form.