-Empty dataset can not be saved

This commit is contained in:
mcndave committed 2026-01-05 12:37:55 +00:00
1 parent 11e436236c
commit 36162c6486
2 files changed
+9 -1

No files matched your search

+4
View File
@@ -199,6 +199,10 @@ class Repository implements RepositoryInterface
if ( $replace || ! $entity->isLoaded() ) {
# $dataset = array_filter($dataset, fn($item, $field) => ! ($this->entityResolver->searchFieldAnnotation($field, new Field, false)->readonly ?? false), \ARRAY_FILTER_USE_BOTH);
if (empty($dataset)) {
throw new \InvalidArgumentException("Unable to add a new row from an empty dataset.");
}
$pdoObject = $this->insertSqlQuery($fieldsAndValue ?? $dataset, $replace)->runInsertQuery();
if ( null !== $primaryKeyDefinition ) {