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 a 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_content
table 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_key
field from modDocument to Article - Change the
show_in_tree
field 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.
[Update] The bug discussed in this post was fixed by JP DeVries in Articles 1.6.6.
Comments (2)
Ian Morgan — Jun 04, 2013 at 11:07 AM
I've just created a wee plugin to combat this.
The code will update class_key from "modDocument" to "Article" and show_in_tree from "1" to "0" if the template is an article template (mine are id#s 15 and 24).
The plugin is set to run on OnDocFormSave
Seems to work...
Hope this is of use to someone :-)
Bob Ray — Jun 05, 2013 at 12:09 AM
Thanks!
I think there's also a pull request pending to fix it within Articles.
Please login to comment.