Merge pull request #2039 from jitendra-webkul/1.0

Issue #1795 fixed
This commit is contained in:
Jitendra Singh 2020-01-13 13:44:37 +05:30 committed by GitHub
commit 9eb107a87f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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);
}
/**

View File

@ -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;
}