From de444a2a5a54c0897a4f6f61e594a3023cde2b4f Mon Sep 17 00:00:00 2001 From: Diogo Peralta Cordeiro Date: Wed, 18 Aug 2021 12:23:22 +0100 Subject: [PATCH] [Posting] Fix wrong usage of DB::findBy --- components/Posting/Posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Posting/Posting.php b/components/Posting/Posting.php index 9478dee214..e5a99fb05d 100644 --- a/components/Posting/Posting.php +++ b/components/Posting/Posting.php @@ -129,7 +129,7 @@ END; DB::flush(); if ($processed_attachments != []) { foreach ($processed_attachments as [$a, $fname]) { - if (is_null(DB::findBy('gsactor_to_attachment', ['attachment_id' => $a->getId(), 'gsactor_id' => $actor_id]))) { + if (empty(DB::findBy('gsactor_to_attachment', ['attachment_id' => $a->getId(), 'gsactor_id' => $actor_id]))) { DB::persist(GSActorToAttachment::create(['attachment_id' => $a->getId(), 'gsactor_id' => $actor_id])); } DB::persist(AttachmentToNote::create(['attachment_id' => $a->getId(), 'note_id' => $note->getId(), 'title' => $fname]));