views:

219

answers:

1

Hiya,

Quick question I think...

I've made a drupal site which has some custom content types. I've created a load of records with these, and then I've had to amend the custom content type to change one of the fields and give it a new default value.

The problem is that existing records do not update with this default value. Apparently i've got to go and re-edit everything to add the default value.

NEW records have the default value. No problem there.

Is this just a Drupal thing or am I missing a trick?

Thanks, Hugh

+2  A: 

I'm pretty sure that this is a 'Drupal thing' (more precisely, a CCK thing ;)

I stumbled over this problem once and as far as I recall, found no logic in CCK to apply changes retroactively to existing nodes. So you'll need to ensure a load/save cycle for every affected node by some means. For small amounts, this might be done via one or the other bulk operation on 'admin/content/node/overview'. For bigger amounts of nodes, this might call for a little script calling node_load(), node_save() on all affected nodes.

Henrik Opel
Hi Henrik, yeah I feared that would be the case! Thanks for the tip, I'll have a look into scripting it all.
hfidgen

related questions