fix(legacy): no invalid track type in smartblock criteria

This commit is contained in:
jo 2022-07-11 16:56:16 +02:00 committed by Jonas L
parent de21e3175a
commit f234aa7c42
1 changed files with 5 additions and 0 deletions

View File

@ -914,6 +914,11 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$element->addError(_('The value should be less then 2147483648'));
$isValid = false;
}
// Unselected track type
if ($d['sp_criteria_field'] == 'track_type_id' && $d['sp_criteria_value'] == 0) {
$element->addError(_('The value cannot be empty'));
$isValid = false;
}
} elseif ($column->getType() == PropelColumnTypes::VARCHAR) {
if (strlen($d['sp_criteria_value']) > $column->getSize()) {
$element->addError(sprintf(_('The value should be less than %s characters'), $column->getSize()));