vBulletin 4 Albums Importer: Comments on pictures are being imported for incorrect images

Affected version
2.2.2

Kirby

Well-known member
Code:
SELECT
    att.*,
    f.*,
    u.username,
    a.*,
    att.attachmentid AS pictureid
FROM attachment AS att

vs

Code:
SELECT
    c.*,
    u.*,
    IF(u.username IS NULL, c.postusername, u.username) AS username,
    c.filedataid AS pictureid
FROM picturecomment AS c

So the media items do get imported using the old field attachmentid, but the comments do use filedataid for lookups - this does not work as those are different IDs (in vBulletin 4 the same filedataid can be used for multiple attachments so they are not necessarily always the same).

The correct ID is in field sourceattachmentid, but to make things a little bit more fun, this field seems to be set to zero for comments that were created with vBulletin 3.

Furthermore, the comment query lacks a check on contenttypeid as only comments for album pictures (buit not social group pictures) can be imported at all.
 
Last edited:
Top