[Posting] Fix wrong usage of DB::findBy

This commit is contained in:
Diogo Peralta Cordeiro 2021-08-18 12:23:22 +01:00 committed by Hugo Sales
parent e40c7b0509
commit de444a2a5a
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -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]));