Hi Meg,
I found the problem! :)
By putting a bunch of calls like:
alert('debug 1');
...
// some code here
...
alert('debug 2');
I was able to trace the source of this error to this line in cms/javascript/LeftAndMain_right.js:
} catch(er) {alert(er.message);}
I basically just kept putting in stuff like alert('debug #'); until I got alerts that came before and after the "Undefined variable" alert and eventually I found that line. It sure was not easy to find though. I thought it was something Safari was throwing up, not a call to alert().
If I ever put in a debug message using alert() I think I'll always try to put in location info so that the source of the error won't be so hard to find (like this one was!).
I made added the location to the error message:
http://www.elijahlofgren.com/silverstripe/patches/Give-location-of-Safari-3-AssetAdmin-Error-alert-cms-gsoc-r38062.patch
and committed it to the cms gsoc svn:
------------------------------------------------------------------------
r38062 | elofgren | 2007-07-06 15:34:13 -0500 (Fri, 06 Jul 2007) | 1 line
Give location of error in the alert() that is inside a catch block in LeftAndMain_right.js CMSForm.loadNewPage() to make debugging Safari 3 problem easier. See: http://www.silverstripe.com/google-summer-of-code-forum/flat/1982
------------------------------------------------------------------------
So basically something in these lines in cms/javascript/LeftAndMain_right.js is triggering an error:
allIframes = this.getElementsByTagName('iframe');
if(allIframes) for(i=0;i<allIframes.length;i++) {
try {
allIframes.contentWindow.location.href = allIframes.src;
} catch(er) {alert('Error in LeftAndMain_right.js CMSForm.loadNewPage(): ' + er.message);}
}
Maybe it's because there are no iframes on the page?
Hope this helps,
Elijah