We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14107
    • 21 Posts
    Hi

    I have noticed a problem on a couple of Revo 2.2.4 sites where I'm using getResources and Friendly URLs. This problem does not seem to be evident sites using older (2.2.0 and 2.2.2) versions of Revo.

    The problem seems to happen whether I use getResources 1.5.0 or 1.5.1

    The scenario is as follows. I have a container resource called 'Latest News' and various news resources below that. The Latest News page uses getResources to pull a summary of each news item and list it on the latest news page.

    My getResources call is

    [[!getResources? &includeContent=`1` &showHidden=`1` &tpl=`NewsPageTpl`]]


    I've tried this with and without the cache flag !

    My template for listing the summaries is

    <div class="latestnews">
    <h3>[[+pagetitle]]</h3>
    <p>[[+content:ellipsis=`150`]]</p>
    <p class="small">Published [[+publishedon:strtotime:date=`%b %d, %Y`]] - <a href="[[~[[+id]]]]">Read more...</a></p>
    </div>
    <hr />


    When I add a new news story, published and hidden from the menu, on the front end, the read more url is 'domain.com' instead of 'domain.com/alias.html'

    This means when people click the link, they get taken to the default error resource.

    I have discovered that if I create the resource then untick the published checkbox then tick the checbox again and save, the read more url is then correct with the alias appended.

    Am I doing something wrong here or is this a bug?
      • 39932
      • 483 Posts
      Fuzzical Logic Reply #2, 14 years ago
      Not necessarily a bug... not necessarily as desired either. There's a little bit of missing information. For instance, when you create a resource, do you always refresh the cache after the initial save? Do you create by Quick Create or use the full editor? Is autopublish set to yes? (etc,etc)

      By default, on the first save, even if the Resource has refresh cache, it doesn't because the resource isn't created until the first save.

      When you first create a resource, there is no alias, so it will always have an initial alias of '' until you change it and save. But since it is the first save, it doesn't automatically refresh the cache, even if you have "refresh cache" clicked. This is why on a new resource, I always save twice. Once to create the resource, once to clear the cache (because I often have refresh cache on save set).
        Website: Extended Dialog Development Blog: on Extended Dialog
        Add-ons: AJAX Revolution, RO.IDEs Editor & Framework (in works) Utilities: Plugin Compatibility List
        Tutorials: Create Cross-Context Resources, Cross-Context AJAX Login, Template-Based Actions, Remove Extensions from URLs

        Failure is just another word for saying you didn't want to try. "It can't be done" means "I don't know how".
        • 14107
        • 21 Posts
        Hello. Thanks very much for your reply.

        It seems that on older versions of modx on the resource settings tab, the option to empty cache is checked by default. On 2.2.4, it seems to be unchecked by default. I failed to notice this until you gave me a clue.

        When I check this box before first save, my url alias works exactly as expected.

        Thank you for your help.