We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10896
    • 76 Posts
    Hey all,

    I have a tv that is a ’text’ field. I’m coming up with problems when a user inputs a tag category like the following

    bed & breakfast

    The ampersand is breaking in the url. I’ve been trying to find the place in the tag filter to enter urlencode/urldecode but I’m not having success. Any help on this?

    Thanks
      • 10896
      • 76 Posts
      I found how to fix this. Not sure if the ditto guys will want to use this in future updates or if there is a better way to accomplish it

      In the file /assets/snippets/ditto/extenders/tagging.extender.inc.php. I added/modified the following lines of code to account for special characters showing up in tags.

      Around line 163
      if ($getTags) { $getTags = urldecode($getTags); }


      Around line 278:
      $tag_url = urlencode($tag);
      
      $tagDocID = (!$tagID) ? $modx->documentObject['id'] : $tagID;
      $url = ditto::buildURL("tags=$tag_url&start=0",$tagDocID);
       
        • 18397
        • 3,250 Posts
        This issue should not be present in Ditto 2.1b3 or later. In that version, the buildURL function properly encodes all url parameters.
          • 10896
          • 76 Posts
          Mark

          I downloaded ditto 2.1.b3 and the issue was still present. I edited tagging.extender.inc.php in order to correct the issue. I used the method above.