We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12712
    • 7 Posts
    I seem to have run into a bug in YAMS 1.1.7 alpha RC7 where putting a dollar sign ($) in front of one or two digits causes them to disappear when the page is rendered. For example, ’$1,000’ turns into just ’,000’ and ’$10’ turns into ’’. Using the HTML Entity $ fixes it, but unfortunately, I need the dollar sign to work for the sake of the client. A quick Google search revealed a similar bug with AjaxSearch that was fixed by escaping a search string before passing it to preg_replace.

    I’ve dug around in the YAMS source for a bit, but I haven’t really made much headway. Has anyone else run into this issue? It happens on both multilingual and monolingual template pages. If I disable the YAMS plugin, everything works fine again. I’m not using PHx and YAMS is first in line for all of its plugin events.

    Thanks in advance!
      • 22851
      • 805 Posts
      PaulSuckling Reply #2, 14 years ago
      Hi there. I can confirm that problem. I must have forgotten to apply preg_quote to part of a string passed to preg_replace. I’ll fix it as soon as possible and get back to you when it’s done.
        YAMS: Yet Another Multilingual Solution for MODx
        YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
        Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
        • 22851
        • 805 Posts
        PaulSuckling Reply #3, 14 years ago
        Yes. I fell into the same trap as AjaxSearch. I forgot to escape the replacement value in a preg_replace. However, I fixed the problem using what I believe to be a better method.

        I’ve just put together a new release of YAMS ( YAMS 1.1.8 ) that contains the patch. See my forum signature for a link. I haven’t yet submitted it to the MODx repository, but I’ll do so soon. EDIT: Just submitted, but it normally takes a while to be approved.
          YAMS: Yet Another Multilingual Solution for MODx
          YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
          Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
          • 12712
          • 7 Posts
          Awesome. Thank you!
          • Just installed this for the first time; will upgrade before I get too far along. Still a lot to learn!
              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
              • 12712
              • 7 Posts
              Hey pms, I installed 1.1.8 and found that YAMS snippet calls for get=`data` were just getting rendered as a YAMS placeholder string instead of the actual value.

              For example:
              [[YAMS? &get=`data` &from=`menutitle` &docid=`[+wf.docid+]`]]

              gets printed into the HTML as:
              ((yams_data:59:menutitle_en))


              I’m not sure if this is a bug or if some functionality changed between 1.1.7 and 1.1.8.
              • Likewise (http://modxcms.com/forums/index.php/topic,49616.0.html) I reverted to 1.1.7 and all is well.
                  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