forked from GNUsocial/gnu-social
		
	[COMPONENT][Attachment][TESTS] Fix Entity/AttachmentTest
This commit is contained in:
		| @@ -221,13 +221,15 @@ class Posting extends Component | ||||
|             Event::handle('ProcessNoteContent', [$note, $content, $content_type, $process_note_content_extra_args]); | ||||
|         } | ||||
|  | ||||
|         // These are note attachments now, and not just attachments, ensure these relations are ensured | ||||
|         if ($processed_attachments !== []) { | ||||
|             foreach ($processed_attachments as [$a, $fname]) { | ||||
|                 // Most attachments should already be associated with its author, but maybe it didn't make sense | ||||
|                 //for this attachment, or it's simply a repost of an attachment by a different actor | ||||
|                 if (DB::count('actor_to_attachment', $args = ['attachment_id' => $a->getId(), 'actor_id' => $actor->getId()]) === 0) { | ||||
|                     DB::persist(ActorToAttachment::create($args)); | ||||
|                 } | ||||
|                 DB::persist(AttachmentToNote::create(['attachment_id' => $a->getId(), 'note_id' => $note->getId(), 'title' => $fname])); | ||||
|                 $a->livesIncrementAndGet(); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user