3

I just want, quickly, to know which content types have comments enabled, without having to go from content type to content type and view the configuration page of each, especially if there are more than fifteen.

3

I searched but I found nothing relative, so I take the initiative to answer my own question.

MySQL seems to be the answer:

mysql> select type from comment c, node n where c.nid = n.nid group by type;
+------------------+
| type             |
+------------------+
| my_content_x     |
| my_content_y     |
| my_content_z     |
+------------------+

This can be equally used:

mysql> select entity_type, bundle from  field_data_comment_body group by entity_type, bundle;
+-------------+-------------------------------+
| entity_type | bundle                        |
+-------------+-------------------------------+
| comment     | comment_node_my_content_x     |
| comment     | comment_node_my_content_y     |
| comment     | comment_node_my_content_z     |
+-------------+-------------------------------+

All nodes which at least have one comment:

mysql> select type, n.nid from comment c, node n where c.nid = n.nid group by n.nid  order by type;
+--------------+------+
| type         | nid  |
+--------------+------+
| my_content_x |  115 |
| my_content_x |  90  |
| my_content_y |  521 |
| my_content_y |  295 |
| my_content_z |  127 |
| my_content_z |  11  |
+--------------+------+

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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