We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8109
    • 128 Posts
    I discovered an unfortunate commenting bug (Revo 2.0.8).

    I have a chunk that returns a doc id. It looks approximately like this:

    [[-comment]]
    [[!$getFeaturedChildOf:notempty=`[[!$getRandomChildOf]]`]]
    


    The return was always coming back with an extra space at the front, thusly: " 234"

    I had tried the If snippet and the output filter, with the same result. I wrote an output modifier using php's trim function to strip the extra space, but it didn't work. Then I used php's ord function and found that what appeared on screen as a space was actually a bracket "[".

    What seems to be happening is that the comment, or part of it, is being returned as part of the chunk output. But why does it appear as white space on screen?

    By putting the comment on the same line as the output modifier code, the problem goes away, so perhaps there's something about a comment with a line return? And of course removing the comment altogether fixed my problem (which was that I wanted to use the doc id to build a url, which didn't like the space or whatever it was).

    (Incidentally, the output modifier is about 60% faster in this case than the If snippet.)

    Cheers!
    [ed. note: drwagner13 last edited this post 12 years, 1 month ago.]
      Revo 2.0.8-pl
      • 3749
      • 24,544 Posts
      Could you file that as a bug here: http://tracker.modx.com/ so it will get fixed.?

      Thanks.


      ---------------------------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
      MODX info for everyone: http://bobsguides.com/modx.html
        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