We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    A client of mine has helped me discover an issue when a pagetitle contains the character [tt]"[/tt]

    Example :

    pagetitle is [tt]Le programme "Vivre avec le Soleil, à l’école"[/tt]

    Generated menu item is :

    [tt]<a école="" l="" à="" soleil,="" le="" avec="" vivre="" title="Le programme " href="/~soleil/ecole/le-programme-vivre-avec-le-soleil-a-lecole.html">Le programme</a>[/tt]

    I guess the " character messes up the link’s construction.
    Of course as it is, the link works, but it breaks validation.

    (several things like [tt]"Vivre" is not a member of a group specified for any attribute[/tt])

    I don’t think it’s an issue with the call but here it is :

    [!Wayfinder? &startId=`6` &level=`1` &limit=`7` &outerTpl=`Outer_Univers` &rowTpl=`Row_Univers` &activeParentRowTpl=`ActiveFolder_Univers` &lastClass=`last2` &hereClass=`actif2`!] 


    Wayfinder version is version 2.0 with MODx 0.9.6.

    Any possible fix other than not using pagetitle for menu items ?
      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l&#39;outil id
      • 25663 MODX Staff
      • 12,272 Posts
      Update the code to escape the quotes and special characters. Probably makes good sense to add that as a part of the base anyway. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 6726
        • 7,075 Posts
        I take it you mean use the 0.9.6 update you did for the alias auto-generation and use it in Wayfinder ?
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 25663 MODX Staff
          • 12,272 Posts
          No ... update Wayfinder’s use of the pagetitle field to escape special characters like quotes, not strip them out.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 6726
            • 7,075 Posts
            OK thanks Ryan I’ll do that and report smiley
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 25663 MODX Staff
              • 12,272 Posts
              Excellent use of the PHP training you had earlier this year. tongue
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 6726
                • 7,075 Posts
                Sure is smiley
                Too bad I had too much business to pratice (summer will be useful, no contracts coming up)

                I admit I am struggling a bit, I looked at every use of str_replace and preg_replace, htmlentities and anything which would look like a replacement array in wayfinder.inc.php but the beast is 600 lines long : so far, no luck undecided (Any pointer ?)

                And my training didn’t cover OO or regular expressions wink
                That’s frustrating !

                I can make sense of about 70% of what’s in there, but there are some thing I am totally lost with... I have never clicked with PHP and I think it will take not only a week’s training + no practice but a few weeks practicing and then another training to really get into it.

                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l&#39;outil id
                  • 11975
                  • 2,542 Posts
                  Hi David,

                  Perhaps in this line (in renderRow function around line 180)

                  //Load row values into placholder array
                          $phArray = array($useSub,$useClass,$classNames,$resource['link'],$resource['title'],$resource['linktext'],$useId,$resource['link_attributes'],$resource['id'],$resource['introtext'],$resource['description'],$numChildren);
                  		
                  


                  :-)
                    Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                    • 6726
                    • 7,075 Posts
                    Thanks smiley

                    Before you hinted at this line I was looking at this

                    $output .= str_replace($usePlaceholders,$phArray,$useChunk);


                    and I did suspect it had something to do with $phArray, but then the code you posted does not help me understanding which character replacement is applied (I guess it takes having a global understanding of wayfinder’s code to grasp this).

                    Anyway it’s a good lesson to be a beginner again, helps reminding you how other’s help and patience is key to progress !
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id