commit
9eb107a87f
|
|
@ -15,7 +15,7 @@ class Decimal implements Rule
|
|||
*/
|
||||
public function passes($attribute, $value)
|
||||
{
|
||||
return preg_match('/^\d*(\.\d{1,2})?$/', $value);
|
||||
return preg_match('/^\d*(\.\d{1,4})?$/', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -184,6 +184,10 @@ abstract class AbstractType
|
|||
continue;
|
||||
}
|
||||
|
||||
if ($attribute->type == 'price' && isset($data[$attribute->code]) && $data[$attribute->code] == '') {
|
||||
$data[$attribute->code] = null;
|
||||
}
|
||||
|
||||
if ($attribute->type == 'date' && $data[$attribute->code] == '' && $route != 'admin.catalog.products.massupdate') {
|
||||
$data[$attribute->code] = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue