1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed CSS errors show even with Debug mode disabled (1.1.5)

Discussion in 'Resolved Bug Reports' started by Chris D, Jun 23, 2013.

  1. Chris D

    Chris D XenForo Developer Staff Member

    I cannot replicate this myself, but @Code Monkey reported to me that he was getting the lovely yellow and orange CSS errors on his site, because my Xen Media Gallery templates contain the use of an undefined style property @enableResponsive.

    My first instinct was that debug mode was enabled, but after ensuring it wasn't enabled the ugly CSS error was still there and visible to all users. Including guests.

    I believe the desired behaviour (therefore this is a bug report) is that these errors only show in debug mode (much like template errors).

    Also, I think it's fair to say that the way the errors display is somewhat overkill. Even if you ARE in a development environment and you do need to see the errors, I don't feel they need to be bright orange and red and override the page background colour. I think printing them at the top of the screen like template errors is more appropriate :)


    EDIT: I have since mitigated the errors myself, using conditionals like this:

    <xen:if is="{$xenOptions.currentVersionId} >= 1020031">
        <xen:if is="@enableResponsive">
        @media (max-width:@maxResponsiveWideWidth)
  2. Code Monkey

    Code Monkey Well-Known Member

    That was the first time I had seen that. I didn't even know it was default warning behavior. Yes it is overkill and either way it should only be displayed according to usergroup permissions IMO.
  3. Mike

    Mike XenForo Developer Staff Member

    It is only displayed in debug mode, but if they are generated in debug mode, then caching may carry them over to other people. (And switching debug mode does not force the cache to be rebuilt.) Maybe we could switch this up a bit, though I'm not sure it should be that significant as I again stress that people shouldn't be running in debug mode in production.
    Chris D likes this.
  4. Chris D

    Chris D XenForo Developer Staff Member

    When it was first reported to me, I couldn't see any CSS errors. Then I went between a couple of pages (as a guest) and it appeared.

    I said the same. It only appears in debug, switch debug off. But then it transpires that debug was only running for @Code Monkey's IP address.

    But I guess that must mean that ultimately debug mode is still enabled.
  5. Mike

    Mike XenForo Developer Staff Member

    That's what I meant about the caching carrying it over to other people.
    Chris D likes this.
  6. Code Monkey

    Code Monkey Well-Known Member

    It seems to me that if debug is only enabled for an IP then only someone connecting from that IP should see any output resulting from debug mode being on. While you are correct that debug shouldn't be run on a production site, there are always times when there is a need to do so.

    And it still showed when debug was off.
    HWS likes this.
  7. Mike

    Mike XenForo Developer Staff Member

    I've adjusted the CSS cache system (in 1.2) to distinguish the cache for debug and no debug which should prevent the issue from moving over to other users if the cache is generated by a user in debug mode.

    Note that this doesn't affect browser caching. Flipping debug mode on and off won't force the CSS cache to be updated in your browser cache - you would need to do a hard refresh.
    Code Monkey, Chris D and CyberAP like this.
  8. Chris D

    Chris D XenForo Developer Staff Member

    Great, thanks.

    Any thoughts on making the error much more subtle than it is now?

    A bit of error text at the top of the page is just about acceptable if you're in a situation where debug mode HAS to be on - even for a few seconds - but taking over the entire background with the bright colours seems a little bit over the top.

    Even as a developer who appreciates the importance of being alerted to template and CSS errors, I would still see the error if the background colour didn't change to yellow :)
    Code Monkey likes this.
  9. Mike

    Mike XenForo Developer Staff Member

    It has been reduced a bit. :)
    Code Monkey and Chris D like this.
  10. Code Monkey

    Code Monkey Well-Known Member

    Thanks Mike and Chris.

Share This Page