You are here

function rb_cck_action_set_field_unvalidated in Rules Bonus Pack 6

Action for 'rb_cck_action_set_field_unvalidated'.

File

./rb_cck.module, line 413
Functions for extending CCK field management with Rules.

Code

function rb_cck_action_set_field_unvalidated($node, $settings) {

  // Get required metadata for the field.
  $storage_key = rb_cck_field_storage_key($settings['field']);

  // Set the field value, and return the node for saving.
  $node->{$settings['field']}[0][$storage_key] = $settings['value'];
  return array(
    'node' => $node,
  );
}