Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Safari 3 Bug... Any Ideas?

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

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

Page: 1
Go to End
Author Topic: 3465 Views
  • Meg
    Avatar
    4 Posts

    Safari 3 Bug... Any Ideas? Link to this post

    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?

  • elijahlofgren
    Avatar
    Google Summer of Code Hacker
    222 Posts

    Re: Safari 3 Bug... Any Ideas? Link to this post

    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.

  • elijahlofgren
    Avatar
    Google Summer of Code Hacker
    222 Posts

    Re: Safari 3 Bug... Any Ideas? Link to this post

    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

  • Meg
    Avatar
    4 Posts

    Re: Safari 3 Bug... Any Ideas? Link to this post

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

  • Sigurd
    Avatar
    Forum Moderator
    628 Posts

    Re: Safari 3 Bug... Any Ideas? Link to this post

    Cheers Elijah for helping out!

  • The Frenchy
    Avatar
    Core Development Team
    40 Posts

    Re: Safari 3 Bug... Any Ideas? Link to this post

    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.

  • 1976
    Avatar
    Community Member
    5 Posts

    Re: Safari 3 Bug... Any Ideas? Link to this post

    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.

  • Sigurd
    Avatar
    Forum Moderator
    628 Posts

    Re: Safari 3 Bug... Any Ideas? Link to this post

    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

    3465 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.