You are here

function rb_cck_action_copy_field_validate in Rules Bonus Pack 6

Validation function for the 'rb_cck_action_copy_field' form.

File

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

Code

function rb_cck_action_copy_field_validate($form, $form_state) {
  $source_field = content_fields($form['settings']['source_field']);
  $target_field = content_fields($form['settings']['target_field']);
  if ($target_field['type'] != $source_field['type']) {
    form_set_error('settings][target_field', t('Target field type must be the
      same as the source field.'));
  }
}