We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26931
    • 2,314 Posts
    Hi there,

    got a strange behaviour on a MODX Evolution 1.0.4 site. Every now and then, the browser will display "NULL" in the top, left corner of the browser before the site renders, then, after rendering "NULL" moves to the center of the browser and stays there until i navigate somewhere else on the site.

    has anyone a clue what this could be? No errors in the system events btw.

    FreeBSD 8.2 amd64
    Apache 2.2.19
    MySQL Server 5.5.14
    PCRE 8.12
    PECL APC 3.1.9
    PHP5 5.3.6

    thanks, j
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Sounds more like a Javascript error to me. Do you have some kind of ad display, newsfeed, Twitter or some other social networking display that could occasionally be coming up with nothing to show (thus generating the "Null")?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 26931
        • 2,314 Posts
        Hi Susan,

        no ads on that site and the social bookmark links are generated with a php snippet.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Can you post (or PM to me) a link to the page in question?
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 26931
            • 2,314 Posts
            yes, sure
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              How very interesting. On first page load, the NULL appears before the HTML doctype declaration (it's moved only after the styling is loaded). On subsequent page loads it doesn't show. That sounds like a cookie issue.

              Sure enough, if I go to my browser and remove the domain's cookies the NULL shows up again. So... you've got something that's reading a cookie and spitting out NULL on first view since the cookie isn't initialized yet.

              The site loads six cookies, one MODx cookie and five others that I-have-no-clue what they are for.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 26931
                • 2,314 Posts
                thanks for pointing in the right direction! I'll look into it
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  The thing is, MODx starts with parsing the template, so the only time something will be output (other than PHP errors, of course, and this clearly is clean output, not error message output) before the doctype is if a snippet is in the template before the doctype (very unusual), in which case that snippet most likely has to be doing something other than working with the page itself. SESSION or COOKIE stuff immediately comes to mind.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org