ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Strange Javascript parsing / Debug Preferences setting bug

January 25, 2008 12:06pm

Subscribe [1]
  • #1 / Jan 25, 2008 12:06pm

    Michael C.

    29 posts

    Ok, this one is really weird.

    I’d gotten a site up and running, one that implemented YUI‘s dropdown menubar for navigation. All’s (relatively) well, until I was going through the EE control panel late one night and saw that I still had the “Debug Preference” in “Output and Debugging Preferences” set to Option 1: “PHP/SQL error messages shown only to Super Admins”. I switched it to Option 0: “No PHP/SQL error messages generated”, and went on my merry way.

    The next day, I noticed that the navigation menus weren’t showing up anymore. The menu bar itself was there, but the arrows next to each item to indicate the presence of a dropdown menu were gone, as were the dropdown menus themselves. I tried in Firefox/Firebug, I tried in IE7/DebugBar - yet I couldn’t find the source of the problem.

    After chasing a few wild geese to try and solve this issue (Firebug was giving me a script parsing error in one of the YUI Menu-related javascripts), I stopped in my tracks and forced myself to think logically: I hadn’t changed anything of the site’s code in over a week - no changes to Javascript, template parsing, or anything of the kind - yet suddenly the menus weren’t working.

    Then I remembered what I had changed: the debug setting the previous night. When I changed it back to Option 1, the menus began working again. I thought this strange, especially since Option 1 was only supposed to output different code if one was logged in as a Super Admin, and I’d already confirmed that the menus didn’t work in IE7, where I wasn’t logged in.

    So, can anyone tell me what exactly this setting does? It seems like it’s making a difference in how EE is parsing the Javascript, since Firebug did give me that weird script parsing error when the menus weren’t working, but I can’t figure it out.

  • #2 / Jan 25, 2008 12:40pm

    Lisa Wess

    20502 posts

    Hi, Michael - see this thread =)

  • #3 / Jan 25, 2008 3:58pm

    Michael C.

    29 posts

    Ah-hah! That definitely explains it. 😊 So, how about a feature to prevent the removal of “leftover” braces from template files that are classified as Javascript, or perhaps a setting to turn off the leftover braces removal on a per-template basis?

  • #4 / Jan 25, 2008 3:58pm

    Lisa Wess

    20502 posts

    You could certainly post a feature request in the Feature Request forum. =)

  • #5 / Jan 25, 2008 4:01pm

    Michael C.

    29 posts

    Gotcha. 😊 Thank’ee kindly, and have a great weekend. 😊

  • #6 / Jan 25, 2008 4:04pm

    Lisa Wess

    20502 posts

    You too, Michael!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases