From 1e515df0b5838cdda37a36286f54f533265b2a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Mon, 22 May 2023 23:06:41 +0200 Subject: [PATCH] Fixed previous commit: Use the same behavior to determine the extension of file attachments like PartKeepr does, to ensure that all attachments are shown as available This fixes issue #291 --- .../PartKeeprImporter/PKImportHelperTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php b/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php index 05137227..a318c281 100644 --- a/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php +++ b/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php @@ -86,7 +86,7 @@ trait PKImportHelperTrait if (empty($attachment_row['extension'])) { //Use mime type to determine the extension like PartKeepr does in legacy implementation (just use the second part of the mime type) //See UploadedFile.php:291 in PartKeepr (https://github.com/partkeepr/PartKeepr/blob/f6176c3354b24fa39ac8bc4328ee0df91de3d5b6/src/PartKeepr/UploadedFileBundle/Entity/UploadedFile.php#L291) - if (empty ($attachment_row['mimetype'])) { + if (!empty ($attachment_row['mimetype'])) { $attachment_row['extension'] = explode('/', $attachment_row['mimetype'])[1]; } else { //If the mime type is empty, we use the original extension