We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36551
    • 416 Posts
    So I'm working on a site today, updating chunks, resources, etc. I uninstall google analytics dashboard and continued editing other resources.

    Two hours later I get a white screen in the manager. I deleted the modx cache, browser cookies cache, disabled css and js compression. I also manually disabled all plugins via PhpMyAdmin. No change.

    Then I find this in the server log in the manager folder.

    [09-Jun-2015 16:29:37 America/Denver] PHP Fatal error: Call to a member function setNamespace() on a non-object in /home1/xxxxxxxx/public_html/core/model/modx/moddashboardwidget.class.php on line 104

    This is the code on that line of the file.

    if (!empty($namespace)) {
    $widget->setNamespace($namespace);
    }

    There is no folder for the analytics folder in the assets/components folder. However, I did notice there is a entry in the modx_dashboard_widget table in the DB for the analytics dashboard. Should that still be there if it were uninstalled?

    Is it possible the uninstall didn't complete correctly?
      • 3749
      • 24,544 Posts
      It looks like that widget's code is trying to execute without successfully instantiating the widget object. The DB record should probably be removed along with the namespace for that widget.

      My guess is that the widget's plugin is still in the cache. Did you manually delete all the files in the core/cache directory?
        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
        • 36551
        • 416 Posts
        Yes, I did manually delete the cache.

        So I should delete that record in the DB along with the record in the namespace table using PhpMyAdmin?
          • 3749
          • 24,544 Posts
          I would, though I'd probably back up the DB first. It never hurts.

          That doesn't explain what's loading the class, though. Take a look in core/components/ for any analytics-widget-related files and check the extension_packages System Setting.

          The weird thing is that it would almost have to be a plugin that's doing it and you said you disabled them all (before or after deleting the core/cache 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
            • 36551
            • 416 Posts
            Thanks Bob

            Deleting those two DB records did the trick. The manager is working again. I've reactivated the plugins. There are no new errors in the modx or server error logs. So it looks like we're back in business.

            There were no analytics files in the core/components folder.

            There still are system settings for this however. Should these be removed as well from the DB?

            Seems like the uninstall process failed to clean up properly.
              • 3749
              • 24,544 Posts
              Generally, if a package throws a fatal PHP error at some point during the uninstall, nothing after that point executes, so lots of stuff can be left behind.

              It's difficult to anticipate all the possible ways that a package might run into trouble on uninstall, but many packages (maybe including some of mine) could use more sanity checks in their uninstall code.

              The System Settings won't hurt anything, but can be removed if you're sure that nothing else is using them. You should be able to delete them in the Manager (which would be the safest route). There may also be a namespace left behind.

              BTW, this prompted me to put a blog article on uninstall tips for package creators in the pipeline. It should be out sometime in July.



                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
                • 36551
                • 416 Posts
                That makes sense.

                Thanks for the info. Looking forward to your blog, even if I don't create packages.