Asgaroth / xupload

XUpload extension for Yii Framework

Home Page:http://www.yiiframework.com/extension/xupload/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xupload 5.0.1 not working with Yii 1.16.1

ifocus22 opened this issue · 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, ));
}

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

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

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.

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

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

@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');

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 notifications@github.com 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:
#27 (comment)

Here a PR : #28
thx for your extension Asgaroth :D
i have no tried with a downgrade of Yii (1.1.15 for ex.)

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

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