Skip to content

Commit 38bc9f5

Browse files
committed
Merge branch 'develop' into unit-testing
2 parents 8501bf5 + 66c1d8a commit 38bc9f5

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

system/Entity.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,13 @@ protected function mutateDate($value)
428428

429429
protected function castAs($value, string $type)
430430
{
431-
if (substr($type, 0, 1) === '?' && $value === null)
431+
if(substr($type,0,1) === '?')
432432
{
433-
return null;
433+
if($value === null)
434+
{
435+
return null;
436+
}
437+
$type = substr($type,1);
434438
}
435439

436440
switch($type)

system/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,8 +1266,8 @@ public function validate($data): bool
12661266
// the value found in $data, if exists.
12671267
$rules = $this->fillPlaceholders($this->validationRules, $data);
12681268

1269-
$this->validation->setRules($rules, $this->validationMessages, $this->DBGroup);
1270-
$valid = $this->validation->run($data);
1269+
$this->validation->setRules($rules, $this->validationMessages);
1270+
$valid = $this->validation->run($data, null, $this->DBGroup);
12711271
}
12721272

12731273
return (bool) $valid;

0 commit comments

Comments
 (0)