function _commerce_pricelist_validate_pricelist in Commerce Pricelist 7
Validate that pricelist exists.
Parameters
$element:
1 string reference to '_commerce_pricelist_validate_pricelist'
- commerce_pricelist_item_form in includes/
commerce_pricelist.admin.inc - Form function to create an commerce_pricelist_list entity.
File
- includes/
commerce_pricelist.admin.inc, line 715 - Summary
Code
function _commerce_pricelist_validate_pricelist($element) {
$value = $element['#value'];
if ($value == '' || !entity_load('commerce_pricelist_list', array(
$value,
))) {
form_set_error($element['#name'], t('Invalid price list'));
}
}