function commerce_product_ui_product_type_form_validate in Commerce Core 7
Validation callback for commerce_product_product_type_form().
1 string reference to 'commerce_product_ui_product_type_form_validate'
- commerce_product_ui_product_type_form in modules/
product/ includes/ commerce_product_ui.forms.inc - Form callback: create or edit a product type.
File
- modules/
product/ includes/ commerce_product_ui.forms.inc, line 132 - Forms for creating / editing and deleting products.
Code
function commerce_product_ui_product_type_form_validate($form, &$form_state) {
$product_type = $form_state['product_type'];
// If saving a new product type, ensure it has a unique machine name.
if (empty($product_type['type'])) {
if (!commerce_product_ui_validate_product_type_unique($form_state['values']['product_type']['type'])) {
form_set_error('product_type][type', t('The machine name specified is already in use.'));
}
}
}