I haven't had much change to investigate, but I get 500 error emails with:
ValueError: invalid literal for int(): 706/img/admin/icon_clock.gif
Looking via Firebug, the src for the image (imported by JavaScript) is
locally referenced, not absolutely in FF3.5. The upper half of this
screen shot is FF3.5:
http://alastairc.ac/testing/django_admin_calendar_images.png
I'm surprised I didn't find more from Googling, apart from a couple of
references to the issue in Safari. Are people not upgrading to FF3.5?
I have a pretty standard (Django 1.0) setup, and it's obviously a
difference in Firefoxs.
-Alastair
My setting is:
ADMIN_MEDIA_PREFIX = '/media/admin/'
Also:
MEDIA_URL = 'http://ukwindsurfing.com/media/'
I'm not sure why a change of browser would affect this?
It does seem to be a JavaScript thing, where the addCalendar (and
clock) function in DateTimeShortcuts.js isn't working?
That function uses:
quickElement('img', cal_link, '', 'src',
DateTimeShortcuts.admin_media_prefix + 'img/admin/icon_calendar.gif',
'alt', gettext('Calendar'));
In FF3.5 that returns img/admin/icon_calendar.gif
In FF3.0 that returns
http://ukwindsurfing.com/media/admin/img/admin/icon_calendar.gif
The prefix is from the init section above:
var idx = scripts[i].src.indexOf('js/admin/DateTimeShortcuts');
DateTimeShortcuts.admin_media_prefix = scripts[i].src.substring(0, idx);
Is that a problem in the new version of Firefox?
-Alastair
Unfortunately my Firebug expertise isn't that great, but with a few
alert boxes, it is the IF statement in DateTimeShortcuts.js that isn't
firing:
var scripts = document.getElementsByTagName('script');
for (var i=0; i<scripts.length; i++) {
if (scripts[i].src.match(/DateTimeShortcuts/)) {
var idx = scripts[i].src.indexOf('js/admin/DateTimeShortcuts');
DateTimeShortcuts.admin_media_prefix = scripts[i].src.substring(0, idx);
break;
}
}
Adding an alert(scripts[i].src) at the top of the FOR loop stops after
the 'core.js' file, so that IF statement never fires.
If I add a console.log at that point, the JavaScript runs, sometimes,
but sometimes stops after core.js.
TinyMCE is two files in the source code, but then it imports another
10 (ish) for the pluggins.
It *seems* like Firefox gives up on the script loop when there are so
many to go through.
My solution has been to move the TinyMCE source files to after the
admin JS, which works for me, but is somewhat annoying.
I'll see if I can put a test case together, it might be worth adding a
bug report somewhere, although I'm not sure if it's for TinyMCE or
Firefox?!?
Thanks,
-Alastair