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

    I just updated MODx to 2.2.2pl and Wayfinder (latest current version), and, the wf.link return nothing, before, no prob, but now, nope', this is my code:

    $html_output = $modx->runSnippet('wayfinder', array(
    		'startId' => 0,
    		'outerTpl' => '@CODE:<ul class="menu-deroulant" style="float:left">[[+wf.wrapper]]</ul>',
    		  'parentRowTpl'=>'@CODE:<li><a href="/[[+wf.link]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>',
    		  'level'=>2,
    		  'hereClass' => '-active',
    		  'firstClass' => '',
    		  'lastClass' => '',
    		  'innerTpl' => '@CODE:<ul class="sous-menu menu-haut-[[+wf.parent]]">[[+wf.wrapper]]</ul>',
    		  'rowTpl' => '@CODE:<li><a href="/[[+wf.link]]" test="[[+wf.docid]]">[[+wf.linktext]]</a></li>'
    		));
    


    The wf.docid return the correct id of each menu (and sub-menu).

    The upgrade of this modx is very hard to rewrite some fonctions, because some of modx function are now deprecated, why a 'patch' can not be writing to correct this, meanwhile is corrected by each webmaster/dev...

    Aaargh !

    Help me.
    Olivier Bolender
      Low
      • 22427
      • 793 Posts
      <a href="/[[+wf.link]]"
      For what reason you have a slash here? Try it without.
        • 17546
        • 75 Posts
        Hi,

        I do not use the base href, also, I use the absolute path as '/', otherwise, each sub-menu will be contatened with the current url.
        Secondly, in your exemple, only the [[+wf.link]] is parsed, and this 'var' is void, empty, null, and I don't know why, the upgrade of modx/wayfinder was broke my menu !!

        Sorry for my english, i'm just french smiley

        Regards,
        Olivier
          Low
          • 17546
          • 75 Posts
          Another thing, when I want to clear my cache, modx show me this in the console:
          Resource URI already exists for resource id = 1; skipping duplicate resource URI for resource id = 894
          ...
          Resource URI already exists for resource id = 1; skipping duplicate resource URI for resource id = 1234
          

          From 894 to 1234, hint ?
            Low
            • 17546
            • 75 Posts
            I Just made a test:

            This is a snippet, name : test-url
            <?php
            $url = $modx->makeUrl(212);
            echo '['. $url .']';
            


            I create a new resource under the root (id:1915) and I enter this code:
            [[!test-url]]
            


            the 212 resource is: (the id resource / alias)

            [] Pays (3/pays)
                 [] Maroc (89/maroc)
                      [] Tourisme (811/tourisme)
                           [] Agadir (212/agadir)
            


            note : The Content type is HTM (extension .htm like HTML)

            Well, now ! I go to the index.php?id=1915 resource, and the page return this:

            []


            ...nothing, the makeUrl() do nothing !!!
            The real result before the update of modx was : pays/maroc/tourisme/agadir.htm

            What's goin'on !
              Low
              • 27708 MODX Staff
              • 2,502 Posts
              As far as I know Wayfinder is not using deprecated functions that broke in 2.2.2. We'd have heard many screams if that were the case.

              Are you seeing any other issues in your Error Log?
                Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                • 25663 MODX Staff
                • 12,272 Posts
                Could it also be that a file was corrupted when uploading (a bad upgrade)?
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 17546
                  • 75 Posts
                  I know wayfinder is not deprecated, I think it's the makeur() function and/or other ones who crashed down !

                  When I clear my cache :
                  ...
                  Resource URI already exists for resource id = 11; skipping duplicate resource URI for resource id = 51
                  Resource URI already exists for resource id = 11; skipping duplicate resource URI for resource id = 154
                  Resource URI already exists for resource id = 11; skipping duplicate resource URI for resource id = 57
                  Resource URI already exists for resource id = 11; skipping duplicate resource URI for resource id = 426
                  Resource URI already exists for resource id = 11; skipping duplicate resource URI for resource id = 424
                  ...
                  

                    Low
                    • 25663 MODX Staff
                    • 12,272 Posts
                    I really suspect an upgrade gone awry. You might try to re-upload the files and re-run the installer.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 17546
                      • 75 Posts
                      @rthrash, maybe, I was thinking about that, I go upload a new version, without setup folder (not necessary I suppose)
                        Low