It’s time to create new post in your MODX Articles Blog. You right-click on your blog container in the tree and select “Write New Article.” The form to create a new blog post comes up, you spend an hour or two writing your blog post, set it as published, and click on the “Save” button. Now, you go to the front end and look at your blog. The new article is not there. You go to back to the Manager and navigate to the Manage Articles panel. It’s not there either, nor is it in the Resources tree at the left. Is all your work lost forever? What happened?
First of all, no, your work is not lost, it’s just hiding. The problem is due to a bug in Articles 1.6.5 and earlier versions. It should be fixed in later releases. If you create an articles by right-clicking in the tree, two fields of the article are set incorrectly. The
class_key field, which should be set to
Article, is set to
modDocument and the
show_in_tree field, which should be set to 0, is set to 1.
Until this bug is fixed, you should create articles from the Manage Articles panel. But what about your missing post? Here’s how to bring it back from the dead.
The fix is relatively simple:
- Log in to your site’s cPanel
- Go into PhpMyAdmin (in the Databases section)
- On the left, select your site’s database
- Find the
modx_site_contenttable and click on its browse link
- Each row is a Resource. Find the missing one.
- Click on the Edit button for the row of your Resource
- Change the
class_keyfield from modDocument to Article
- Change the
show_in_treefield from 1 to 0
- Click on the “Go” button at the bottom of the page
Tip: When searching the
modx_site_content table, you can click on the ID column header to sort the Resources by ID. If you click again, it will reverse the sort and your new Resource should be at or near the top.
That’s all there is to it. Your new blog post should now reappear in all its glory. Have a beer.
Until the bug is fixed, create Articles by clicking on your blog container Resource. Then, click on the “New Article” button.
[Update] This bug has been fixed in the latest version of Articles.