nEwZ - sCRiPTz-TEAM.iNFO

A printed version of the article

Click here to view the article in its original format

nEwZ - sCRiPTz-TEAM.iNFO _ vBulletin - ImpEx _ [IMPX-363] Attachment import in vB4 is incomplete

Added by: sCRiPTz-TEAM.iNFO Mon, 07 June 2010

After importing attachments into vBulletin 4, you'll face two problems:

1.)
You are not able to build thumbnails, because filedata.extension is not set.

2.)
The asset manager doesn't show the imported attachments, because attachmentcategoryuser is empty.

To fix those issues after the import, you can run those 2 querys:

Fix for 1.)
UPDATE filedata AS filedata
LEFT JOIN attachment AS attachment ON (attachment.filedataid = filedata.filedataid)
SET extension = RIGHT(attachment.filename, LENGTH(attachment.filename) - LOCATE('.', attachment.filename, LENGTH(attachment.filename) - 4));

Fix for 2.)
INSERT INTO attachmentcategoryuser (
SELECT attachment.filedataid, attachment.userid, 0, attachment.filename, attachment.dateline
FROM attachment
LEFT JOIN attachmentcategoryuser ON (attachmentcategoryuser.filedataid = attachment.filedataid)
WHERE attachmentcategoryuser.filedataid IS NULL);

--------------
And actually there is a third "problem": The attachment import only works if you store the attachments in the database instead of the file system - but that's a known issue.



Source: http://tracker.vbulletin.com/browse/IMPX-363

Powered by nEwZ - sCRiPTz-TEAM.iNFO
© sCRiPTz-TEAM dEv. (sCRiPTz-TEAM.iNFO)