We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5160
    • 118 Posts
    I migrated a Revolution 2.3.2 site which runs the Asset Manager extra to a new location on the same server. All seems well however selecting a Resource to edit results in error:

    PHP Fatal error:  Call to a member function getAssets() on a non-object in C:\inetpub\vhosts\domain.com\subdomains\stage\core\components\assman\controllers\PageController.php on line 179


    This relates specifically to the Asset Manager extra, line 179 of PageController.php is:

    $this->config['PageAssets'] = $PA->getAssets($page_id);


    The MODX Error Log contains:

    (ERROR @ /manager/Index.php) Path specified for package assman is not a valid or accessible directory: C:inetpubvhostsdomain.comsubdomainsstage/core/components/assman/model/


    Clearly there is no path separator, C:inetpubvhostsdomain.comsubdomainsstage should be C:inetpub/vhosts/domain.com/subdomains/stage but I can't figure how the path is generated or why it should fail following migration.

    I un-installed and re-installed the Asset Manager Extra but this does not help and none of the assman System Settings appear to be relevant.

    Can anyone help with this?

    This question has been answered by BobRay. See the first response.

    • discuss.answer
      • 3749
      • 24,544 Posts
      Check the path of the Assman namespace (Gear Icon -> Namespaces).
      Also, check the path in the Assman entry in the modx_extension_packages System Setting (if there is one).

      If neither of those pays off, look at the modx_extension_packages table in PhpMyAdmin to see if there's an incorrect Assman path there.
        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
      • Actually this sounds like another instance of the workspaces issue, which I've never been able to resolve.

        http://forums.modx.com/thread/80883/can-t-install-reinstall-packages
        http://forums.modx.com/thread/83363/db-problem-after-moving-to-another-server

        For some reason, when moving from one server to another packages seem to retain the actual servername in the path that MODX uses to access the packages. Under normal circumstances the servername is not even necessary, which is why this is such a strange issue.

        The only way I've gotten this to effectively resolve is to uninstall packages one by one (each version) till there are no more versions to uninstall. Then, remove the package entirely. First within the MODX manager, and then check that the transport.zip and package folders are completely gone from the core/packages folder. Clear the core/cache files and reinstall/MODX.

        I recall someone else rewriting the workspaces table setting to an absolute url, which worked but would be incorrect. The {core_path} really should work fine if MODX didn't want to look at a path that included the servername for some wacky reason.
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 5160
          • 118 Posts
          check the path in the Assman entry in the modx_extension_packages System Setting (if there is one).

          Genius, thank you. System Settings > System & Server: extension_packages was:

          [{"assman":{"tablePrefix":"ass_","path":"C:inetpubvhostsdomain.comsubdomainsstage/core/components/assman/model/"}}]


          But should be:

          [{"assman":{"tablePrefix":"ass_","path":"C:inetpub/vhosts/domain.com/subdomains/stage/core/components/assman/model/"}}]


          With this updated I can view Resources without error.

          On a separate note I notice under Namespaces the Assets Path for assman is:

          /Users/everett2/Sites/revo2/public_html/assets/repos/assetmanager/assets/


          This must relate to Everett's development environment and is the same in both the original site and the in the new location it was migrated to. It doesn't seem to affect the Extra though.
            • 5160
            • 118 Posts
            @Frogabog I didn't see your response until after I'd replied to BobRay. The symptoms were similar to the workspaces issue. I'd already tried rolling Asset Manager back 1 version (there have been two releases at the time of writing) and re-installing but didn't check that the transport.zip and package folders were completely gone.
              • 3749
              • 24,544 Posts
              Is there anything in assets/components/assman? If not, it probably doesn't use its assets path for anything.
                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
                • 5160
                • 118 Posts
                Yes, /assets/components/assman/ contains directories css, images and js with a few files in each.
                  • 3749
                  • 24,544 Posts
                  The code probably uses MODX_ASSETS_PATH, which is correct (or $modx->getOption('assets_path') ). I'm not sure the namespace assets path is ever used for anything at present.
                    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
                    • 53517
                    • 1 Posts
                    2 1/2 years later this has just helped us out no end. Thanks Bob and Chris !