0

I have a content type with a field_FOO of type text. I have a procedure that check which nodes have this field_FOO without value ($node->field_FOO == array() ), extract 1 at random, make some operations, set a value for this field (field_FOO[LANGUAGE_NONE][0]['value'] = 'bar') and save the node.

Now for 10.000+ nodes I need to delete this value but I don't want to do a node_load, empty field_FOO, node_save because for every node_save Drupal change the changed date associated with that nodes.

So, how can I "delete" the value of a field without use node_save()? If I delete the entry from field_data_field_FOO table I risk a site down ?

In the field_data_field_FOO table there is a "deleted" column. If I set it to 1, at the next hook_cron() that fields are deleted without a site down ?

Thanks.

1 Answer 1

0

If you want to do by changing the database entry then you need to check key constraints for the field table and also you need to remove its dependency from the parent table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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