Changing Input format for all instances of a field
Hello all! I need to change the input format for all instances of a certain CCK field. What is the best way to go about this? There are about 2,000 nodes that need to be updated. What's the best way to do this? Thanks in advance! Brian
The input format is stored as an integer in the database. You should be able to just go to the appropriate CCK table in the database and run an UPDATE query on it manually. You'll then want to clear all caches to make sure it takes effect. I do not know of any more automated method, but it's a simple process in SQL. --Larry Garfield Brian Vuyk wrote:
Hello all!
I need to change the input format for all instances of a certain CCK field. What is the best way to go about this? There are about 2,000 nodes that need to be updated. What's the best way to do this?
Thanks in advance!
Brian
Which CCK table would that be? It's not stored in the content_type_* or content_field_* tables. It may be in the serialized arrays in content_node_field or content_node_field_instance, but changing those didn't seem to have an effect. Brian larry@garfieldtech.com wrote:
The input format is stored as an integer in the database. You should be able to just go to the appropriate CCK table in the database and run an UPDATE query on it manually. You'll then want to clear all caches to make sure it takes effect.
I do not know of any more automated method, but it's a simple process in SQL.
--Larry Garfield
Brian Vuyk wrote:
Hello all!
I need to change the input format for all instances of a certain CCK field. What is the best way to go about this? There are about 2,000 nodes that need to be updated. What's the best way to do this?
Thanks in advance!
Brian
Are you certain? The field itself is not, or the format info is not? It's probably best to move this to IRC, as it's turning into site support more than Drupal development. :-) --Larry Garfield Brian Vuyk wrote:
Which CCK table would that be? It's not stored in the content_type_* or content_field_* tables. It may be in the serialized arrays in content_node_field or content_node_field_instance, but changing those didn't seem to have an effect.
Brian
larry@garfieldtech.com wrote:
The input format is stored as an integer in the database. You should be able to just go to the appropriate CCK table in the database and run an UPDATE query on it manually. You'll then want to clear all caches to make sure it takes effect.
I do not know of any more automated method, but it's a simple process in SQL.
--Larry Garfield
Brian Vuyk wrote:
Hello all!
I need to change the input format for all instances of a certain CCK field. What is the best way to go about this? There are about 2,000 nodes that need to be updated. What's the best way to do this?
Thanks in advance!
Brian
Brian Vuyk wrote:
I need to change the input format for all instances of a certain CCK field. What is the best way to go about this? There are about 2,000 nodes that need to be updated. What's the best way to do this? This is best done in the mysql client using a update with a join between the 'node' and 'node_revision' tables filtering out only the 'type' you want. -mf
Michael Favia wrote:
Brian Vuyk wrote:
I need to change the input format for all instances of a certain CCK field. What is the best way to go about this? There are about 2,000 nodes that need to be updated. What's the best way to do this? This is best done in the mysql client using a update with a join between the 'node' and 'node_revision' tables filtering out only the 'type' you want. -mf node_revisions only holds the format for the 'body' field. It doesn't touch CCK stuff.
Brian
The safest way will always be to go through Drupal and use the node save functions (through a custom script, feedapi, etc.) because any related data will also be updated. Otherwise, modules will miss the opportunity to hook in. However, your integer field is probably safe to change directly in the database if you don't want to spend a lot of time on it. - Ken Winters On Sep 28, 2009, at 11:36 AM, Brian Vuyk wrote:
Hello all!
I need to change the input format for all instances of a certain CCK field. What is the best way to go about this? There are about 2,000 nodes that need to be updated. What's the best way to do this?
Thanks in advance!
Brian
participants (4)
-
Brian Vuyk -
Ken Winters -
larry@garfieldtech.com -
Michael Favia