Skip to content

Commit 1f43b01

Browse files
author
David Nahodyl
committed
return 0 when no fm record ID is given since no records are deleted
1 parent 695859d commit 1f43b01

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Database/Query/FMBaseBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ public function delete($recordId = null)
236236
{
237237
$this->recordId($recordId ?? $this->getRecordId());
238238

239+
// return 0 if there's no record ID, as we can't delete anything
240+
// deleting nothing is supported normally, but should return a 0
241+
if ($this->getRecordId() === null) return 0;
242+
239243
return $this->connection->deleteRecord($this);
240244
}
241245

0 commit comments

Comments
 (0)