0

I forgot to turn off the comments while creating a content type. Now when i set the Comments to Closed, the form for adding a comment is still being displayed in full node view.

Any suggestions?

Thanks!

8
  • Yes, tell us what error message are you getting, when you save with "comments: off". It's on the screen, in watchdog, or possibly in webserver's log. Oh, and have you cleared your caches?
    – Mołot
    Commented Jul 17, 2014 at 8:29
  • No errors. The comments simply don't get closed. Commented Jul 17, 2014 at 8:38
  • Obviously, it's not Drupal's standard behaviour. It must be caused by something you or your sysadmin installed / coded / configured etc. And we have only the data you put in your question. So, sadly, it's up to you to find what exactly stopped your settings form from being saved. Only when we know what happened, we have a chance to tell you how to deal with it. Or you can hire a contractor and give him all needed credentials to debug this for you.
    – Mołot
    Commented Jul 17, 2014 at 8:40
  • The problem was that i already had some content of this content type, and all nodes had the comments set to "Open" due to configuration of the content type at the moment of creation. Once I had it set to "Closed" on every node of this type, it worked like expected. Thank you Sir for your time. Commented Jul 17, 2014 at 9:21
  • Welcome to Drupal Answers! We give answers, not suggestions. You should give all the details, in the question. You forgot saying you had nodes of that content type and you were wondering why on those nodes the comments were still open; from what you wrote, I took you changed the settings for a content type, and then created the first node of that content type.
    – apaderno
    Commented Jul 17, 2014 at 10:03

1 Answer 1

3

This setting only sets the default for nodes, so already created nodes will still have their comments turned on. Easiest way to update all the nodes is with a couple of SQL statements, back up your database first.

UPDATE node SET comment = 0 WHERE type = 'your_content_type';

UPDATE node_revision nrev
  INNER JOIN node nd ON nrev.nid = nd.nid AND nd.type = 'your_content_type'
  SET nrev.comment = 0;

then clear cache.

Note that comment can equal the following:

0 = disabled 1 = readonly 2 = read/write.

More details at How to finally disable comments on content type?

Not the answer you're looking for? Browse other questions tagged or ask your own question.