Opened 12 years ago

Closed 12 years ago

#2680 closed defect (fixed)

Small correction in DateTimeShortcuts.js

Reported by: ant9000@… Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The last Mozilla security update for Debian Sarge (Debian/1.7.8-1sarge7.2.1) crashes when executing this Javascript code; the problem is that 'cal_nav' is wrongly added a second time to 'cal_box' (the first time is in 'quickElement()').

Of course, this is clearly a Mozilla bug introduced with the update (old version did not choke on that line); nonetheless, the code in question is incorrect... since you are not the only perfectionists out there, here's a patch :-)

--- django/contrib/admin/media/js/admin/DateTimeShortcuts.js    (revision 3738)
+++ django/contrib/admin/media/js/admin/DateTimeShortcuts.js    (working copy)
@@ -171,7 +171,6 @@
         cal_nav_prev.className = 'calendarnav-previous';
         var cal_nav_next = quickElement('a', cal_nav, '>', 'href', 'javascript:DateTimeShortcuts.drawNext('+num+');');
         cal_nav_next.className = 'calendarnav-next';
-        cal_box.appendChild(cal_nav);

         // main box
         var cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num);

Happy hacking,


Change History (1)

comment:1 Changed 12 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [3748]) Fixed #2680 -- Made small correction to DateTimeShortcuts.js that was causing problems in newest Mozilla security update for Debian. Thanks, ant9000@…

Note: See TracTickets for help on using tickets.
Back to Top