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>';
UPDATE `modx_site_content` SET `show_in_tree`='1', `hide_children_in_tree`='0', `deleted`='1' WHERE class_key='Article'
That may be because the Articles class and map files are gone, so MODX/xPDO doesn't know that an Article extends modResource.Just noticed I hadn't replied on this - it worked - the resources have now finally gone, and the error has stopped showing - thank you and apologies for not responding earlier. It's much appreciated.
I would back up the DB with Export in PhpMyAdmin (if you haven't already) before running the query below.
This is probably the fastest and most reliable (if I have it correct). Just go into PhpMyAdmin, open the MODX DB, put this line in the query input on the SQL tab, and click on "Go" (or "Simulate Query" first, to make sure it finds records):
UPDATE `modx_site_content` SET `show_in_tree`='1', `hide_children_in_tree`='0', `deleted`='1' WHERE class_key='Article'
Change the prefix on modx_site_content if your site uses a different prefix.
You can run it again with 'ArticlesContainer' at the end instead of 'Article' to modify the container.