Skip to content

Commit 91b06e9

Browse files
author
Christian Blanquera
committed
optional fieldset validation fix
1 parent ec04136 commit 91b06e9

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

src/Model/Validator.php

+7-21
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,11 @@ public function getCreateErrors(array $data, array &$errors = [], $fieldset = nu
7171
$errors[$name][$index] = [];
7272
}
7373

74-
$errors[$name][$index] = $this
75-
->getCreateErrors(
76-
$row,
77-
$errors[$name][$index],
78-
Fieldset::i($field['field']['parameters'])
79-
);
80-
81-
$errors[$name][$index] = $this
82-
->getOptionalErrors(
83-
$row,
84-
$errors[$name][$index],
85-
Fieldset::i($field['field']['parameters'])
86-
);
74+
$errors[$name][$index] = $this->getCreateErrors(
75+
$row,
76+
$errors[$name][$index],
77+
Fieldset::i($field['field']['parameters'])
78+
);
8779

8880
if (empty($errors[$name][$index])) {
8981
unset($errors[$name][$index]);
@@ -126,7 +118,7 @@ public function getCreateErrors(array $data, array &$errors = [], $fieldset = nu
126118
}
127119
}
128120

129-
return self::getOptionalErrors($data, $errors);
121+
return $this->getOptionalErrors($data, $errors, $fieldset);
130122
}
131123

132124
/**
@@ -171,12 +163,6 @@ public function getUpdateErrors(array $data, array &$errors = [], $fieldset = nu
171163
Fieldset::i($field['field']['parameters'])
172164
);
173165

174-
self::getOptionalErrors(
175-
$row,
176-
$errors[$name][$index],
177-
Fieldset::i($field['field']['parameters'])
178-
);
179-
180166
if (empty($errors[$name][$index])) {
181167
unset($errors[$name][$index]);
182168
}
@@ -203,7 +189,7 @@ public function getUpdateErrors(array $data, array &$errors = [], $fieldset = nu
203189
}
204190
}
205191

206-
return self::getOptionalErrors($data, $errors);
192+
return $this->getOptionalErrors($data, $errors, $fieldset);
207193
}
208194

209195
/**

0 commit comments

Comments
 (0)