By Paul Iliano on
I enabled and configured Comments on a site which already has nodes. New nodes indeed have the possibility to add comments now. The problem is the nodes that existed before enabling Comments lack the comments possibility.
I wonder whether this is by design, or I'm doing something wrong. How can I get comments on these old nodes, i.e nodes submitted before Comments was turned on?
Thanks,
Paul
Comments
How many nodes are you talking about?
The problem is probably that those nodes were created without a value for whether to allow comments. You can change that by editing the node and selecting one of the options for User comments. The choices are: Disabled, Read only, or Read/write.
Obviously, if you are talking about hundreds of nodes, this is going to be a pain to do one by one...So you would want to make this change via a MySQL query.
---
Code Orange: Drink Your Juice
Can anyone give me the MySQL script to update old nodes?
Yes, you are right: on the old nodes, I see that User Comments are disabled under node > edit. I see how I could change them individually by hand.
Could you or someone else help me out with the MySQL query to change old nodes? I have no database knowledge, but I can execute a script via the control panel of my web site.
Maybe this will work
Unless You have db prefixing this should work:
It should enable read/write comments on all nodes.
If You want read-only set it to "1".
If You have table names prefixed, You should add prefix to "node" before executing SQL command.
Thanks!
Thanks very much: I tried it and it worked beautifully!
Why not enable comments on existing nodes by default?
So my problem is solved via the kind help I got. But I have a more fundamental thought on how Drupal handles turning on Comments.
When one turns on Comments, should old nodes not also get comments enabled by default? Or perhaps the administrator could have the choice between yes or no to enable comments on old nodes?
In my case, I wanted to wait until book nodes were matured after rewriting before enabling comments. There are probably other scenarios where you would want existing nodes to have comments too when you turn comments on.