Latest Yii: Problems With Jquery And Jquery-Ui

In one of my projects I was using YII 1.1.8 until now. However, when I upgraded to YII 1.1.12, suddenly jQuery’s attr()-method appears to have been changed: it doesn’t return strings anymore, but jQuery objects. At once all my javascripts where broken, since I rely heavily on attr().

Also I got pestered with a javascript error, complaining about a non existing method g.split() in jQuery-UI. This resulted in my jQuery-UI tabs not being generated anymore.

Needless to say I promptly downgraded to YII 1.1.8, so my scripts worked as expected again.

I hope this can be fixed?

Regards!

I think Yii will (and should) keep integrating the latest stable versions of jQuery and jQuery UI.

So, generally speaking, if you want to continue to use the latest version of Yii, I think you have to update your code, instead of insisting Yii to use the outdated code.

One thing you can do right now is setting the script map like this:




Yii::app()->getClientScript()->scriptMap = array(

	'jquery.js' => 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.x/jquery.min.js',

	'jquery.min.js' => 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.x/jquery.min.js',

	'jquery-ui.min.js' => 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.xx/jquery-ui.min.js',

);



By doing this kind of thing, you will be able to use the latest Yii with the older versions of jQuery and jQuery UI.

But in the long run, you may encounter a compatibility issue even with this workaround, anyway.