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

    I recently found that my error log had become huge - it just has this within:
    [2017-11-16 17:19:07] (ERROR @ /home/server/public_html/core/xpdo/xpdo.class.php : 644) Could not load class: ArticlesContainer from mysql.articlescontainer.
    


    I used to have articles installed, but I removed it, but I assume something is lurking around that should be deleted.

    The error seems to occur when navigating around the Manager, rather than the front end.

    Any ideas what this could be?


    Thanks
    Andy


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

      • 3749
      • 24,544 Posts
      Check the extension_packages System Setting.

      If this is all that's there, you can make it blank:

      [{"articles":{"path":"[[++core_path]]components/articles/model/"}}]


      That will try to make it load articles on every page load.

      Look for a left over Articles-related plugin (e.g., articlestags).

      Also, sometimes plugins get stuck in the cache and the only way to remove them is manually delete all the 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
        • 51020
        • 670 Posts
        Quote from: BobRay at Nov 16, 2017, 09:49 PM
        Check the extension_packages System Setting.

        If this is all that's there, you can make it blank:

        [{"articles":{"path":"[[++core_path]]components/articles/model/"}}]


        That will try to make it load articles on every page load.

        Look for a left over Articles-related plugin (e.g., articlestags).

        Also, sometimes plugins get stuck in the cache and the only way to remove them is manually delete all the cache files.

        Thanks Bob,
        The articles code doesn't appear in the extension_packages system setting - the only thing in there relates to Collections.
        I've ben trying to find a list of Articles-related plugins so I can check if I have any - My only thought is that I AM using Archivist, Tagger and Taglister - but as far as I know, they are independent to Articles? I have reinstalled the above anyway just in case.
        I have also emptied the cache manually.

        But I still get the error logs every time I view a resources in the Manager. I don't get it when I view chunks, templates TVs etc - JUST resources.

        All I can think is that it's a plugin somewhere, but I don't know what Articles installs and cannot seem to find a list in the docs to check.

        Andy
          • 51020
          • 670 Posts
          UPDATE:
          I've just been digging around in the database, and I can see a number of Resources with the Class Key of Article, and ArticlesContainter.

          Strangely, they are in the database, but do not exist in the resource tree. If I try to edit them by the ID number in the URL, ie:
          https://www.domain.co.uk/manager/?a=resource/update&id=23

          it says the resource doesn't exist.

          The 'deleted' column in the database says 0.

          I can't understand why they are still there when the resources don't seem to exist, but is it safe to delete them manually form the database - I know you've said before that can be dangerous, but not sure what else I can do?

            • 3749
            • 24,544 Posts
            Articles never show in the Resource Tree. If you right-click on the Blog Container (if it's still there) and select Manage Articles, you should see them.
              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
              • 51020
              • 670 Posts
              Quote from: BobRay at Nov 17, 2017, 11:31 PM
              Articles never show in the Resource Tree. If you right-click on the Blog Container (if it's still there) and select Manage Articles, you should see them.

              Ah ok. The container is also missing but in the database. What about if I change the container class key to a standard resource in the dB?
                • 51020
                • 670 Posts
                Or maybe I should reinstall articles and then if they show up in the resource tree, delete them then?

                Is that a plan?
                  • 3749
                  • 24,544 Posts
                  Let's back up. If you're using Collections, it may be using 'Article' for the class_key field, so make sure that's not the case before proceeding, or you may end up deleting things you wanted to keep.

                  This utility snippet (untested) might a simpler solution to making those pages visible:

                  [[!FixArticles]]



                  /* FixArticles Snippet */
                  $docs = $modx->getCollection('modResource', array('class_key' => 'Article'));
                  
                  $count = 0
                  foreach ($docs as $doc) {
                      $count++;
                      $doc->set('show_in_tree', true);
                      $doc->set('hide_children_in_tree', false);
                      $doc->set('deleted', true); // optional
                      $doc->save();
                  }
                  
                  return '<h3>Altered ' . $count . ' Resources</h3>';
                  


                  That should make them visible, and it should mark them for deletion, so you could delete all of them by emptying the trashcan. [ed. note: BobRay last edited this post 6 years, 5 months ago.]
                    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
                    • 51020
                    • 670 Posts
                    Quote from: BobRay at Nov 19, 2017, 09:55 PM
                    Let's back up. If you're using Collections, it may be using 'Article' for the class_key field, so make sure that's not the case before proceeding, or you may end up deleting things you wanted to keep.

                    This utility snippet (untested) might a simpler solution to making those pages visible:

                    [[!FixArticles]]



                    /* FixArticles Snippet */
                    $docs = $modx->getCollection('modResource', array('class_key:IN' => array('Article',ArticlesContainer)));
                    
                    $count = 0;
                    foreach ($docs as $doc) {
                        $count++;
                        $doc->set('show_in_tree', true);
                        $doc->set('hide_children_in_tree', false);
                        $doc->set('deleted', true); // optional
                        $doc->save();
                    }
                    
                    return '<h3>Altered ' . $count . ' Resources</h3>';
                    


                    That should make them visible, and it should mark them for deletion, so you could delete all of them by emptying the trashcan.

                    Thanks - I just tried this.
                    I ran it in a new resource, and it came back with:
                    Altered 0 Resources


                    Really strange - whatever I try it says they don't exist, but ~I can see them in the database.

                      • 3749
                      • 24,544 Posts
                      Oops. I can see why (no quotes around ArticlesContainer), but I realized that the ArticlesContainer is already visible, so try this version:

                      /* FixArticles Snippet */
                      $docs = $modx->getCollection('modResource', array('class_key' => 'Article'));
                      
                      $count = 0;
                      foreach ($docs as $doc) {
                          $count++;
                          $doc->set('show_in_tree', true);
                          $doc->set('hide_children_in_tree', false);
                          $doc->set('deleted', true); // optional
                          $doc->save();
                      }
                      
                      return '<h3>Altered ' . $count . ' Resources</h3>';
                      
                      [ed. note: BobRay last edited this post 6 years, 5 months ago.]
                        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