From 8ebbd52a99b91d452e88baee8457c7836cd25656 Mon Sep 17 00:00:00 2001 From: Jeppe B <2jepp9350@gmail.com> Date: Wed, 10 Jun 2026 18:40:34 +0200 Subject: [PATCH] Normalize attachment object type lookups --- services/nginx/app/classes/attachments.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/nginx/app/classes/attachments.php b/services/nginx/app/classes/attachments.php index cbf84b64..abefdc1d 100644 --- a/services/nginx/app/classes/attachments.php +++ b/services/nginx/app/classes/attachments.php @@ -133,8 +133,14 @@ class attachments implements attachments_i protected function fetchAttachmentRows(string $type, array $object_ids, array $options = []): array { $options = $this->normalizeAttachmentOptions($options); + $rawType = trim($type, '`'); + $objectTypes = array_values(array_unique([ + $rawType, + '`' . $rawType . '`', + ])); + return (new object_attachments_o())->getFieldsWhereIn([ - 'object_type' => $type, + 'object_type' => $objectTypes, 'object_id' => $object_ids, 'deleted_at' => null ], $options);