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

    I have a modx 2.2.4 install, a string of invisible characters began appearing at the top of every document.

    • In the output, invisible characters appear, across all templates. Even a document with a blank ("0") template has invisible characters inserted before anything else.
    • And non-cached pages with the blank template--coming directly from db--have the invisible characters

    But strangely clearing the cache fixes the issue?

    Why would clearing the cache fix the problem of invisible characters appearing at the top of a non-cached, blank template resource?

    Any clues? Thanks!


      • 3749
      • 24,544 Posts
      What characters are being inserted? Paste them here inside code tags.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 3749
        • 24,544 Posts
        What characters are being inserted? Paste them here inside code tags.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
        • I'd suspect, without any more info, something like UTF8 BOM characters in the template ... i.e. something that doesn't cause a problem when being retrieved from the database but that could cause a problem if written to a cache file.

          If you are copying and pasting your template code from a text editor, try saving as UTF8 (no BOM) first and then copying and pasting ... like I said, just a guess at the moment.
            Garry Nutting
            Senior Developer
            MODX, LLC

            Email: [email protected]
            Twitter: @garryn
            Web: modx.com
            • 8784
            • 32 Posts
            Quote from: BobRay at Mar 28, 2013, 03:30 AM
            What characters are being inserted? Paste them here inside code tags.

            Hey Bob,

            Here is the offending output…

            EDIT: The pasted text breaks the forum "code".
            EDIT2: The text won't paste into "Pastebin" either
            EDIT3: The offending text is attached as a .html file

            EDIT4: The sample .html won't attach either? Okay, I've put it on a AWS EC2 instance: http://ec2-50-19-151-149.compute-1.amazonaws.com/example-bad-characters.html
            Please note:

            • This is not where the actual page is hosted.
            • It appears webkit browsers will auto-strip the offending text, but Firefox will keep it intact. (So grab the source using Firefox.)


            And here's how it looks in bbEdit:

            [ed. note: elvispresley2k last edited this post 11 years, 1 month ago.]
            • Hm. Nothing there, not even in the page source.
                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
                • 8784
                • 32 Posts
                Quote from: garryn at Mar 28, 2013, 05:50 AM
                I'd suspect, without any more info, something like UTF8 BOM characters in the template ... i.e. something that doesn't cause a problem when being retrieved from the database but that could cause a problem if written to a cache file.


                The offending characters were appearing on resources with *no* template and no caching.

                Quote from: garryn at Mar 28, 2013, 05:50 AM

                If you are copying and pasting your template code from a text editor, try saving as UTF8 (no BOM) first and then copying and pasting ... like I said, just a guess at the moment.

                I tried pasting very simple text from bbEdit into a resource's content area, but it made no difference, the bad characters still appeared. bbEdit is set to "Unicode UTF-8, Unix LF".

                I also tried pasting the text from bbEdit directly into the the resource's content in the database, but this made no difference either, same bad characters inserted at the top of the output.
                • That's quite a lot of invisible characters.
                    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