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

    I'm stumped by a broken Wayfinder menu when on a symlink.

    I'm getting inconsistent behavior from Wayfinder and/or UltimateParent that seems to relate to page caching. Depending on if the linked-to resource or the symlink is the first to be cached, the resulting menu can break.. See bottom of the post for reference & technical details.

    SITE SETUP

    In a nutshell, I have symlink resources -- and some "regular" resources in their own "special audiences" part of the tree -- so content editors can cherry-pick site content for particular visitor audiences on a neat and clean menu. For the sample tree below, I want visitors to resources #9,10,11, 12 & 13 to see a menu of those documents when on any of those documents.

    PROBLEM

    If the first save to the page cache is for the symlink (vs. to its actual source resource, for example symlink ID 11, which links to ID 3), all works well and the symlink shows the correct Wayfinder output for its "special audience" section.

    If, however, from a clean cache, a resource that is linked to by a symlink (using the same example, resource ID 3) is the first to be written to cache, the Wayfinder menu shown for the symlink resource (ID 11) shows resources #3, 4 and 5.

    If one of the actual non-symlink resources (for example, ID 10 or 12) is selected, the menu is correct in all cases.


    • Clearing cache (manually and via manager) and trying again shows this to be repeatable
    • Setting the symlink resource to non-cached stops the problem, but obviously comes with a performance penalty
    • All combinations of cached / uncached calls to Wayfinder and UltimateParent fail to prevent the problem
    • Changing Wayfinder cacheResults setting does not alter the behavior
    • I looked through the changelog for Revo 2.2.1-pl, and don't see anything that applies
    • No user groups / permissions / resource groups, etc. have been assigned at all on this install

    Any ideas out there? I'm stumped.

    Second question -- if the "real" resource is cached and its symlink(s) aren't is there a real performance penalty? Maybe that is an acceptable solution if no substantial performance hit.


    BACKGROUND

    Wayfinder Call

    [[Wayfinder? &startId=`[[UltimateParent? &topLevel=`3`]]` &displayStart=`1` &startItemTpl=`wayfinderNavSecondaryStartItemTpl` &rowTpl=`wayfinderRowTpl`]]


    wayfinderNavSecondaryStartItemTpl

    <h1>[[+wf.linktext:htmlent]]</h1>[[+wf.wrapper]]


    wayfinderRowTpl

    <li[[+wf.id]][[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title:htmlent]]" [[+wf.attributes]]>[[+wf.linktext:htmlent]]</a>[[+wf.wrapper]]</li>



    Resource Tree (D "regular resource document", S symlink. Digits = resource ID)

    Web Root
    |--Home (D: 1)
    |--ParentA (D: 2)
       |--ChildA (D: 3)
       |--ChildB (D: 4)
       |--ChildC (D: 5)
    |--ParentB (D: 6)
       |--ChildA (D: 7)
    |--Special Audience Collections (D: eight)
       |--Special AudienceA (D: 9)
          |--AudienceA Doc1 (D: 10)
          |--AudienceA Symlink1 (S: 11, linked to D3)
          |--AudienceA Doc2 (D: 12)
          |--AudienceA Symlink2 (S: 13, linked to D5)
       |--Special AudienceB (D: 14)
          |--AudienceB Doc1 (D: 15)
    
    etc.
    


    Server: Apache 2.2.22
    OS: linux 2.6.32-20120131.55.1.bh6.x86_64
    DB: MySQL: 5.1.61-community-log

    MODX:
    Revolution 2.2.0-pl2 (advanced) - core outside of document_root
    Friendly-URL enabled (and working)
    Related packages installed:
    Wayfinder 2.3.3-pl
    UltimateParent 2.0-pl
    [ed. note: clareoconsulting last edited this post 14 years, 5 months ago.]
      • 22303 MODX Staff
      • 10,725 Posts
      Sounds like you may have found a bug, either with Wayfinder or Symlinks in general. Would you mind opening a ticket for this in our tracker?
        • 36816
        • 109 Posts
        Thanks Jason -- will submit a ticket yet today.

        Meantime -- any opinion on how much performance penalty I'll pay having non-cached symlinks point to cached "regular" resources? Do I get any benefit by the underlying resource pointed-to by the symlink being cached itself?

        This seems to be my only work-around for a feature the client really wants.
          • 44234
          • 219 Posts
          Hi,

          I have also run into this problem, except it effects all tags/tv's/snippets, not just wayfinder.

          For example:

          • Resource 01 (symlink target)
          • Resource 02 (symlink)

          Both resources are cached and use different templates (relevant tv's are available to both).
          I have changed the content of [[*longtitle]], TV A and TV B in Resource 02.

          If Resource 02 is cached/viewed first then it displays correctly, with [[*longtitle]], TV A and TV B all showing the changed content specific to Resource 02.

          If Resource 01 is cached/viewed first then Resource 02 displays in-correctly, with [[*longtitle]], TV A and TV B all showing the target content specific to Resource 01.

          Wayfinder and custom snippets all suffer the same problem.

          I have experimented with calling the tags/tv's uncached but makes no difference. The only workaround is setting the symlink (Resource 02) to deselect [[*cacheable]] in settings tab (as per 'clareoconsulting' post above).

          This effectively renders cached symlinks unusable.

          I have added this post to the bug in the tracker, does any know when this is likly to be fixed?

          Thanks

          *I am using MODX Revolution 2.2.6-pl (advanced) [ed. note: last edited this post 13 years, 7 months ago.]
            Find me on Twitter, GitHub or Google+