Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Safari 3 Bug... Any Ideas?


Go to End


8 Posts   4421 Views

Avatar
Meg

4 Posts

7 July 2007 at 6:59am

Hey folks,

As you know I've been working on getting Silverstripe compatible with Safari 3, however there's one bug that I can't seem to resolve. Under asset management in the CMS, when one selects a folder name in the left pane, Safari will throw up an error message: Undefined value. (This is Safari 3.0.2 beta on OS 10.4.10)

What's weird about this one is that except for the pop up, it's like no bug ever occurred. No javascript error is logged to the Safari debugging console, and there's no error at all when it's run through WebKit. Weird, right? On the other hand, when it's run through Safari using Drosera the application will crash at that point every time.

Any brave souls willing to try it out and let me know what they think?

Avatar
elijahlofgren

Google Summer of Code Hacker, 222 Posts

7 July 2007 at 7:35am

Not that these help, but here are 3 places I found that seem to refer to this type of error:

1. "to my cart, but a JS error prevented it from working. TypeError: Undefined
value" http://bugs.webkit.org/show_bug.cgi?id=12595
2. "Safari displays an "Undefined Value" for every DWR call. " http://www.nabble.com/Problems-with-2.0-rc2-and-rc1-on-Safari-t2932547.html
3. "I get a dialog saying it could not do it, "TypeError: Undefined value" whatever that means." http://thesmallwave.blogspot.com/2007/06/mini-review-of-apples-safari-browser-on.html#comment-3753038350734172830

I'm going to look at what happens when a folder is clicked and see if I can find any clues to what is triggering this error.

Avatar
elijahlofgren

Google Summer of Code Hacker, 222 Posts

7 July 2007 at 8:41am

Edited: 07/07/2007 8:46am

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

Avatar
Meg

4 Posts

7 July 2007 at 9:17am

Awesome dude - that's a big help. Thanks!

Avatar
Sigurd

Forum Moderator, 628 Posts

7 July 2007 at 1:10pm

Cheers Elijah for helping out! :)

Avatar
The Frenchy

Core Development Team, 40 Posts

8 November 2007 at 2:17pm

I have found where the problem comes from (thanks to the alert window content changes).

Actually, it's everytime you add an ImageField or FileIFrameField in a page and I don't know why it happens only on Safari 3.

I am working on this problem but unfortunately, I can't manage to add the debug mode and the console on my Safari 3 beta for windows.

If u have any ideas about that, it will help me.

Avatar
1976

Community Member, 5 Posts

18 March 2008 at 2:11pm

Just wondering if anyone has picked this up since Nov 07?

Not sure if it will help anyone but I've attached a screenshot of an error I get in Opera 9.25 when clicking on the site content tree in the admin.

Is this javascript error related to the Safari 3 gallery compatibility error?

I'd really like to be able to see lightwindow working in Safari 3 as it should.

Avatar
Sigurd

Forum Moderator, 628 Posts

25 March 2008 at 9:29pm

tin_soldier, no screenshot attached.

if you have a reliably-produceable bug please submit it at open.silverstripe.com, after checking its not a duplicate :)