Modify

Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#10688 closed defect (fixed)

TypeError: a.curCSS is not a function (Trac 1.1.1dev-r11469)

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: AdminEnumListPlugin
Severity: normal Keywords:
Cc: Stepan Riha, Jun Omae Trac Release: 1.2

Description (last modified by Ryan J Ollos)

The following errors are seen with Trac 1.1.1dev-r11469:

Firefox 16:

[10:46:52.715] TypeError: a.curCSS is not a function @ http://localhost:8000/tracdev/chrome/common/js/jquery-ui.js:5

Chrome 23:

Uncaught TypeError: Object function (a,b){return new p.fn.init(a,b,c)} has no method 'curCSS'

Trac 1.0 has:

  • jQuery 1.7.2
  • jQuery UI 1.8.21

Trac 1.1.1dev has:

There is an incompatibility between jQuery 1.8 and jQuery UI < 1.8.22, as described here. I'll open a ticket for this in the Trac core, and implement a workaround in the plugin code.

Attachments (0)

Change History (12)

comment:1 Changed 12 years ago by Ryan J Ollos

Status: newassigned

I've filed a ticket in Trac for the jQuery/jQuery UI compatibility issue in t:#10976.

comment:2 Changed 12 years ago by Ryan J Ollos

Description: modified (diff)

comment:3 Changed 12 years ago by Ryan J Ollos

(In [12417]) Refs #10688: Implemented workaround for "curCSS is not a function" error when using jQuery UI < 1.8.22 with jQuery 1.8.x.

comment:4 Changed 12 years ago by Jun Omae

After r12417, the following error happens with Trac 0.11.7.

Timestamp: 2012-12-09 20:51:02
Error: too much recursion
Source File: http://localhost:3000/chrome/common/js/jquery.js
Line: 11

Applying the following patch, it works on Trac 0.11.7, 0.12.4, 1.0 and trunk (t:r11479).

  • adminenumlistplugin/htdocs/adminenumlist.js

     
    1414    // Trac 1.1.1dev @r11479 provides jQuery UI 1.8.21 and jQuery 1.8.2
    1515    // http://bugs.jquery.com/ticket/11921
    1616    if(!$.isFunction($.fn.curCSS))
    17         $.curCSS = $.css;
     17        $.fn.curCSS = $.fn.css;
    1818   
    1919    var mouseY, lastY = 0;
    2020   

comment:5 Changed 12 years ago by Ryan J Ollos

Thanks, I'll apply that fix. That is interesting though. It must be an issue with an older version of jQuery then? The line in my patch was copied from the jQuery UI patch.

comment:6 Changed 12 years ago by Ryan J Ollos

In Chrome 23 and the latest Trac trunk, I'm still seeing an error in the JS console after applying the patch:

Uncaught TypeError: Object function (a,b){return new p.fn.init(a,b,c)} has no method 'curCSS' 

The plugin seems to work fine though.

comment:7 Changed 12 years ago by Ryan J Ollos

Maybe we have a different issue here though. In the jQuery ticket it was noted that curCSS has been deprecated since jQuery 1.3 and was removed in 1.8. With Trac 0.11.7 we are working with jQuery 1.2.6. The conditional was intended to evaluate to false for jQuery < 1.8, since curCSS should still be available (though deprecated).

comment:8 Changed 12 years ago by Jun Omae

Oh, sorry. I mistook. I rework..., the fix needs checking existence of $.curCSS instead of $.fn.curCSS.

$.cssCSS $.fn.curCSS notes
0.11.7 function undefined jQuery 1.2.6
0.12.4 function undefined jQuery 1.4.4
1.0 function undefined jQuery 1.7.2
trunk undefined undefined jQuery 1.8.2
  • adminenumlistplugin/htdocs/adminenumlist.js

     
    1313    // Workaround for issue when using jQuery UI < 1.8.22 with jQuery 1.8
    1414    // Trac 1.1.1dev @r11479 provides jQuery UI 1.8.21 and jQuery 1.8.2
    1515    // http://bugs.jquery.com/ticket/11921
    16     if(!$.isFunction($.fn.curCSS))
     16    if(!$.isFunction($.curCSS))
    1717        $.curCSS = $.css;
    1818   
    1919    var mouseY, lastY = 0;

comment:9 Changed 12 years ago by Ryan J Ollos

Thanks, that works for me too. I can extend your list as follows:

$.curCSS $.fn.curCSS notes
0.11.0 function undefined jQuery 1.2.3

comment:10 Changed 12 years ago by Ryan J Ollos

(In [12423]) Refs #10688: Fixed check for existence of curCSS function. Thanks to Jun Omae for the fix.

comment:11 Changed 12 years ago by Ryan J Ollos

In [12463] I had to check for $.fn.prop; checking for $.prop didn't seem to work. The only difference I see between these two cases is the possibility that jQuery might treat a function alias differently than a function.

comment:12 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.