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

    I recently tried to update my test server VM from 2.4.2 to something newer and encountered problems:
    Wayfinder does not show the menu and internal links do not work when FURLs are enabled.

    The Upgrade install runs through smoothly without errors, but after the first page load I get:
    [2016-04-27 23:42:41] (ERROR @ /usr/local/www/modx/core/model/modx/modx.class.php : 690) PHP warning: Invalid argument supplied for foreach()

    in the error log.

    I tried 2.4.3, 2.4.4 and 2.5 (rolling back to the last working VM snapshot in between), the only difference between the versions is that the line number changes, but the error always comes from the getParentIds function, when it tries to access the resourceMap.

    So I went to see the content of modx/core/cache/my.config/context_settings/web/context.cache.php and noticed, that resourceMap is completely missing from the array, whereas aliasMap is definded, but empty:
    'aliasMap' =>
      array (
      ),

    When I compare the file contents to the version before the upgrade, aliasMap and resourceMap are there and filled properly.

    So I went to check the database:
    "select uri, alias from modx_site_content;"

    shows URI and alias columns are filled correctly.

    The system is running with php 5.6.20 (not yet upgraded to php 7).

    I also tried the following steps:

    • resetting permissions in all directories by chowning everything to the correct owner and group
    • emptying the cache from manager before upgrading
    • deleting the cache directory contents before upgrading
    • Manage->Clear Cache->Recalculate URIs
    • turning on and off FURLs in settings (internal site navigation works when FURLs are off)
    • recalculateURIs.php (found that in an older post)

    The other odd thing I notice is, that before the upgrade, I have the directories "mgr", "web" and "test" in the context_settings directory, whereas after deleting the cache directory and upgrading there are only the directories "mgr", "web" left.
    I remember having a "test" context, which I deleted long ago, so maybe it was just still sitting there in the cache directory (I have never emptied the cache directory manually before).

    Could you please give me advice what to try or where to look next? I can always roll back to the working 2.4.2 snapshot and try different steps over again if necessary.

    Regards,
    Marc
      • 9674
      • 170 Posts
      Marc
      Silly question, but did you update the wayfinder package before going to Revo 2.5 ?

      Philippe
        • 52196
        • 3 Posts
        Hi Philippe,

        No, I didn't update any packages before or after the upgrade. The Wayfinder package is at version 2.3.3.

        Marc
          • 3749
          • 24,544 Posts
          You want to manually delete the core/cache files and your browser cache and cookies *after* the upgrade, though I'm not sure that will fix your problem. If you use the UpgradeMODX widget, it will clear the cache for you at the end of the install.

          getParentIds() should always include the context in an array as the third argument:

          $pids = $modx->getParentIds($id, 10, array('context' => 'web'));


          Do you have this in the head section of all templates (with multiple contexts, it should always be uncached -- with the exclamation point, and have no closing tag):

          <base href="[[!++site_url]]" />


          If you uploaded the MODX files individually with FTP -- that often results in missing or corrupted files.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 9674
            • 170 Posts
            Usual good advise, Bobby Ray smiley
              • 52196
              • 3 Posts
              Hi, just a little status update: I am still working on it:

              Quote from: BobRay at Apr 28, 2016, 08:15 PM
              You want to manually delete the core/cache files and your browser cache and cookies *after* the upgrade, though I'm not sure that will fix your problem. If you use the UpgradeMODX widget, it will clear the cache for you at the end of the install.
              I have tried several variations: not deleting anything, deleting the cache before, then after, then both - none helped.
              I don't use the upgrade widget, because I have an advanced install with the core folder moved out of the webserver's root - and I am not sure whether the widget can handle this.

              Quote from: BobRay at Apr 28, 2016, 08:15 PM
              getParentIds() should always include the context in an array as the third argument:

              $pids = $modx->getParentIds($id, 10, array('context' => 'web'));
              That's the point where I still have to search where this could be called. I suppose it's Wayfinder or getResources - and I am almost, but not 100% sure it doesn't get called directly anywhere in chunks or snippets:

              I am using a template which I have bought from ThemeForest a year ago, which makes heavy use of all different kinds of addons, snippets and plugins. I customized it heavily for my purpose: I reworked it from a single-page template to a multipage template - so I don't think I will get support from the creator. I think I will have to work through all elements one by one.

              Quote from: BobRay at Apr 28, 2016, 08:15 PM
              Do you have this in the head section of all templates (with multiple contexts, it should always be uncached -- with the exclamation point, and have no closing tag):

              <base href="[[!++site_url]]">
              Yes, this is embedded exactly this way into a chunk called html_head which gets called in the page template as:
              [[$html_head]]

              I am not sure if I need to call if with "!" in front in the template - I have read in the change logs that there have been some changes with caching and the non-cacheable flag. Maybe this is some side-effect I am facing?

              Quote from: BobRay at Apr 28, 2016, 08:15 PM
              If you uploaded the MODX files individually with FTP -- that often results in missing or corrupted files.
              No, I did a wget and used plain unzip and chown -R www:www on the unzipped folder before cp-ing it with -a into the right place. ;-)

              BobRay, thank you for the suggestions and for the honor of having you replying to my post.
              Your questions and replies on this forum have been a great resource for me in the past year.
              It worked out so well, that I didn't feel need to sign up for the forum because I found all answers most often from your replies - well, up until now.

              Regards,
              Marc
                • 3749
                • 24,544 Posts
                Thanks for the kind words. smiley

                You might try moving the base href tag up into the Template. It may not help, but it can't hurt. I think you want it uncached. If that setting a cached (and I think it still is) you don't want to use the cached value from the previous visitor.

                I can't think of a reason why the aliasMap would be empty, though, and I think that's definitely your issue.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting