PHRAS-3628 : 500 on API.create record

fix error 500 on api_v3 / records / POST with no file
(dbox.records.type should be "unknown", not null)
This commit is contained in:
jygaulier
2022-01-13 10:59:22 +01:00
committed by GitHub
parent b7a1b383f2
commit 60ae82272a

View File

@@ -1876,7 +1876,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$stmt->execute([
':coll_id' => $collection->get_coll_id(),
':parent_record_id' => 0,
':type' => $file ? ($file->getType() ? $file->getType()->getType() : 'unknown') : null,
':type' => $file ? ($file->getType() ? $file->getType()->getType() : 'unknown') : 'unknown',
':sha256' => $file ? $file->getMedia()->getHash('sha256') : null,
':uuid' => $file ? $file->getUUID(true) : null,
':originalname' => $file ? $file->getOriginalName() : null,