xupload icon indicating copy to clipboard operation
xupload copied to clipboard

Xupload 5.0.1 not working with Yii 1.16.1

Open ifocus22 opened this issue 10 years ago • 10 comments

Thanks for this great extension. I'm using it properly with Yii framework v 1.15.

I tried the same code with 1.16.1 but it's failing. The widget is displayed properly but the upload does not work. No info in tha app log, no error in the js console. I'm using the basic scenario :

public function actions() { return array( 'upload'=>array( 'class' =>'xupload.actions.XUploadAction', 'path' =>Yii::app() -> getBasePath() . "/../uploads", 'publicPath' => Yii::app() -> getBaseUrl() . "/uploads", ), ); }

public function actionIndex()
{

  Yii::import("xupload.models.XUploadForm");
    $model = new XUploadForm;
    $this -> render('index', array('model' => $model, ));
}

ifocus22 avatar Jan 06 '15 18:01 ifocus22

Same thing here (not working with yii 1.1.16) ! But i have an javascript error :

Error jquery : TypeError: that is undefined options = that.options,

The object "options" seem empty

gplaza avatar Jan 09 '15 12:01 gplaza

try changing the code in assets/jquery.fileupload-ui.js

from var that = $(this).data('fileupload'); to var that = $("#fileupload").data('blueimpUI-fileupload');

http://stackoverflow.com/questions/23762825/why-is-this-datamycontrol-undefined

dev3k avatar Feb 22 '15 12:02 dev3k

Looks like Yii 1.1.16 updated the included version of jquery, so the correct solution would be to update the corresponding jquery upload library included in this extension.

I am no longer supporting this extension, so I am looking for any interested maintainers.

Please submit a PR, not sure how to transfer the access to updating the extension in the Yii site, probably just remove the downloads there, and point to this repository would work.

Asgaroth avatar Feb 23 '15 17:02 Asgaroth

@dev3k : This change doesn't work :( same problem with Yii 1.1.16

gplaza avatar Feb 25 '15 14:02 gplaza

@gplaza you have to replace all the recurrences, try my working version of the file https://jsfiddle.net/khalilmajdalawi/os2gtamt/

dev3k avatar Feb 25 '15 14:02 dev3k

@dev3k : Sorry you are right ! I have changed this : var that = $(this).data('fileupload'); to var that = $("#fileupload").data('blueimpUI-fileupload');

but in reality it's just the sample of stackoverflow .... (#fileupload)

the good change is : var that = $(this).data('blueimpUI-fileupload');

gplaza avatar Feb 25 '15 16:02 gplaza

Is it possible that one of you can create a PR? I can update the extension page in the yii site.

On Wed, Feb 25, 2015 at 11:01 AM, gplaza [email protected] wrote:

@dev3k : Sorry you are right ! I have changed this : var that = $(this).data('fileupload'); to var that = $("#fileupload").data('blueimpUI-fileupload'); but in reality it's just the sample of stackoverflow .... (#fileupload) the good change is :

var that = $(this).data('blueimpUI-fileupload');

Reply to this email directly or view it on GitHub: https://github.com/Asgaroth/xupload/issues/27#issuecomment-75986966

Asgaroth avatar Feb 25 '15 16:02 Asgaroth

Here a PR : https://github.com/Asgaroth/xupload/pull/28 thx for your extension Asgaroth :D i have no tried with a downgrade of Yii (1.1.15 for ex.)

gplaza avatar Feb 25 '15 18:02 gplaza

Does it work if you replace assets/jquery.fileupload-ui.js with the latest version of the jquery plugin ?

Asgaroth avatar Feb 26 '15 03:02 Asgaroth

@Asgaroth : no, there is lot of refactoring to create if you update with the last version of Jquery Plugin. for a simple fix is more simple to only change jquery.fileupload-ui.js.

ps : I'm not an expert in javascript but i have tried it.

gplaza avatar Feb 26 '15 12:02 gplaza