Skip to content

Commit 8863f7a

Browse files
committed
Fix validation for multi select
1 parent f59d6b8 commit 8863f7a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

system/Validation/Validation.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,15 @@ public function run(array $data = null, string $group = null, string $db_group =
172172

173173
$value = dot_array_search($rField, $data);
174174

175-
$this->processRules($rField, $rSetup['label'] ?? $rField, $value ?? null, $rules, $data);
175+
if (! is_array($value))
176+
{
177+
$value = [$value];
178+
}
179+
180+
foreach ($value as $val)
181+
{
182+
$this->processRules($rField, $rSetup['label'] ?? $rField, $val ?? null, $rules, $data);
183+
}
176184
}
177185

178186
return ! empty($this->getErrors()) ? false : true;

0 commit comments

Comments
 (0)