Skip to content

Commit 4d518d2

Browse files
committed
Set error in Validation collector if it is available
1 parent 7a6a3c6 commit 4d518d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Model.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,10 @@ protected function setDuplicateEntryError(string $message) : void
826826
if ($field === 'PRIMARY') {
827827
$field = $this->getPrimaryKey();
828828
}
829-
$this->getValidation()->setError($field, 'unique', []);
829+
$validation = $this->getValidation();
830+
$validation->setError($field, 'unique');
831+
$validation->getDebugCollector()
832+
?->setErrorInDebugData($field, $validation->getError($field));
830833
}
831834

832835
/**

0 commit comments

Comments
 (0)