Trac: javascript error using ubuntu packaged JQuery

Bug #1653144 reported by David Girault
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
trac (Ubuntu)
New
Undecided
Unassigned

Bug Description

When loading our http://example.com/trac/browser/ repository browsing page, there is a javascript error in keyboard_nav.js.

According to JQuery documentation, the live function is deprecated since 1.7 and removed since 1.9. But installed libjs-jquery is version 1.11.3 !

This error result in no other 'ready' function executed and so expanding folder in browser did not work!

Related package versions:
libjs-jquery 1.11.3+dfsg-4
trac 1.0.9+dfsg-1

Tags: patch jquery
Revision history for this message
David Girault (dfgweb) wrote :
Revision history for this message
David Girault (dfgweb) wrote :

This bug is already fixed uplink in their 1.2-stable branch but NOT in their 1.0-stable.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Diff between original and fixed deploted versions" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
David Girault (dfgweb)
summary: - Trac still use deprecated and removed live function of jquery
+ Trac: javascript error using ubuntu packaged JQuery
Revision history for this message
David Girault (dfgweb) wrote :

Another javascript error when clicking on a line on a blame view in browser (ie. http://example.com/trac/browser/project/trunk/Makefile?annotate=blame&rev=28):

blame.js:92 Uncaught TypeError: Cannot read property 'mozilla' of undefined
    at Object.success (blame.js:92)
    at fire (jquery.js:2)
    at Object.fireWith [as resolveWith] (jquery.js:2)
    at done (jquery.js:5)
    at XMLHttpRequest.callback (jquery.js:5)
(anonymous) @ blame.js:92
fire @ jquery.js:2
fireWith @ jquery.js:2
done @ jquery.js:5
callback @ jquery.js:5

Faulty code:

// workaround non-clickable "Close" issue in Firefox
if ($.browser.mozilla || $.browser.safari)
  message.find("div.inlinebuttons").next().css("clear", "right");

It seems $.browser is undefined in installed JQuery !

Revision history for this message
David Girault (dfgweb) wrote :

The following patch will fix both javascript error.

Patch quickly made against installed js files in /usr/lib/python2.7/dist-packages/trac/htdocs/js and modified js files in deployed environment in /var/www/html/trac/htdocs/common/js.

Revision history for this message
David Girault (dfgweb) wrote :

I had made a updated version for the trac package. See my PPA.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.