Skip to content
Permalink
Browse files

In case that value of submitted image type is empty and required set to

ture, then return an validation error.
  • Loading branch information...
satelines committed Apr 4, 2019
1 parent 7a24529 commit 750a2dd0e5df0bb0ebf40d3761546dbf0979b8bd
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/midcom/datamanager/validation/imageValidator.php
@@ -12,7 +12,8 @@ class imageValidator extends ConstraintValidator
{
public function validate($value, Constraint $constraint)
{
if ( !empty($value['delete'])
if ( empty($value)
|| !empty($value['delete'])
|| ( empty($value['file'])
&& ( empty($constraint->config['do_not_save_archival'] && empty($value['archival']))
xor empty($value['main'])))) {

0 comments on commit 750a2dd

Please sign in to comment.
You can’t perform that action at this time.