Skip to content

Firefly III: a personal finances manager

Fix https://github.com/firefly-iii/firefly-iii/issues/9447

James Cole2714ee96f1e3
diff --git a/app/Api/V1/Controllers/Models/Attachment/StoreController.php b/app/Api/V1/Controllers/Models/Attachment/StoreController.php
index 5c9edf7d3c..5e852608d0 100644
--- a/app/Api/V1/Controllers/Models/Attachment/StoreController.php
+++ b/app/Api/V1/Controllers/Models/Attachment/StoreController.php
@@ -112,7 +112,12 @@ class StoreController extends Controller
return response()->json([], 422);
}
- $helper->saveAttachmentFromApi($attachment, $body);
+ $result = $helper->saveAttachmentFromApi($attachment, $body);
+ if(false === $result) {
+ app('log')->error('Could not save attachment from API.');
+
+ return response()->json([], 422);
+ }
return response()->json([], 204);
}
diff --git a/app/Helpers/Collector/Extensions/AttachmentCollection.php b/app/Helpers/Collector/Extensions/AttachmentCollection.php
index 6140a20ba4..6e93eeed87 100644
--- a/app/Helpers/Collector/Extensions/AttachmentCollection.php
+++ b/app/Helpers/Collector/Extensions/AttachmentCollection.php
@@ -93,7 +93,7 @@ trait AttachmentCollection
->where(
static function (EloquentBuilder $q1): void { // @phpstan-ignore-line
$q1->where('attachments.attachable_type', TransactionJournal::class);
- $q1->where('attachments.uploaded', true);
+ // $q1->where('attachments.uploaded', true);
$q1->whereNull('attachments.deleted_at');
$q1->orWhereNull('attachments.attachable_type');
}
diff --git a/config/firefly.php b/config/firefly.php
index 034fb9af7d..4f93904520 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -255,6 +255,7 @@ return [
'allowedMimes' => [
// plain files
'text/plain',
+ 'text/html',
// images
'image/jpeg',