I have over 300 nodes of a content type created with CCK. Originally I set comment settings to disabled. Now I want to change that setting to Read/Write. Is there a way to change the setting on all the nodes of that type without having to go and edit each node?
I've changed the settings for that node type but the change only affects new nodes.
Thank you.

Comments

WorldFallz’s picture

not through the ui afaik, but you could do it with sql.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

daniel sanchez’s picture

Thanks. So that would be something like:
SELECT * FROM `node` WHERE `type` = 'workbook_lesson' and `comment` = 0;
But I have to write the SQL to change comment to 2. Is that correct?

WorldFallz’s picture

Sounds about right to me but i always have to have the db visible with phpmyadmin whenever I write sql, lol.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

daniel sanchez’s picture

Does this seem like the correct SQL code?
UPDATE `database_name`.`node` SET `comment` = '2' WHERE `node`.`type` = 'workbook_lesson' LIMIT 1 ;
I"m a little afraid of messing with my Drupal install from phpMyAdmin.

DanielJohnston’s picture

Did this go anywhere? I'm looking at doing the same thing. It's a shame that views bulk operations doesn't have the right action to update the nodes.

daniel sanchez’s picture

I've been kinda afraid to try it. Haven't had time to back everything up and be prepared for something nasty to happen.

conniec’s picture

I did it!

In phpAdmin click on your table.
Go to SQL
Type in:

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

substituting your content type for ''your_content_type

This worked for me but be sure to back up your database first, just in case
Connie

MidGe48’s picture

Just the reverse of what you would like to do!

http://drupal.org/node/363505

www.ZuNOB.com

daniel sanchez’s picture

OK. That worked out well.