If you look between the list_getFiles and list_getNumFiles we are doing 2 different filters for the WHERE
In list_getNumFiles we do:
WHERE a.attachment_type = {int:attachment_type}
AND a.id_member = {int:guest_id_member}',
And in list_getFiles we do:
WHERE a.attachment_type = {int:attachment_type}
I'm not sure why. It doesn't seem to be causing any issues far as I can tell. I wanted to hear feedback before suggesting we fix it though.
Looking at the attachment tables for one of my forums, it appears that id_member is only stored for avatars and not for regular attachments (or attachment thumbnails for that matter). I guess that's because every attachment is associated with a post and we can get the id_member from there instead.
Correct. Attachments are message-specific. Avatars are user-specific.
Which explains why it hasn't caused a bug. So this is a minor code cleanup. Nothing critical, but could be sent up in another PR to standardized the queries.