You are here

function uc_coupon_purchase_attribute_form_validate in Ubercart Discount Coupons 7.3

Extra validation callback for uc_attribute_form.

1 string reference to 'uc_coupon_purchase_attribute_form_validate'
uc_coupon_purchase_form_uc_attribute_form_alter in uc_coupon_purchase/uc_coupon_purchase.module
Implements hook_form_FORM_ID_alter() for uc_attribute_form.

File

uc_coupon_purchase/uc_coupon_purchase.module, line 499

Code

function uc_coupon_purchase_attribute_form_validate($form, $form_state) {

  // For a new attribute, prevent use of the reserved name.
  if (empty($form['aid']) && $form_state['values']['name'] === UC_COUPON_PURCHASE_RECIPIENT_ATTRIBUTE) {
    form_set_error('name', t('The name is reserved for use by uc_coupon_purchase.'));
  }
}