camel1cz / phorum2phpbb

phpBB plugin (convertor) to migrate from Phorum5 to phpBB 3
GNU General Public License v2.0
3 stars 2 forks source link

Attachments broken in replies #2

Open classofoutcasts opened 6 years ago

classofoutcasts commented 6 years ago

In phpbb3.2.3 all attachments - except for the opening post in a topic - are broken. This is due to the way the conversion script populates the phpbb_attachments table. In 'convert_phorum5.php' this code on line 337 will break attachments for posts which are replies:

array('topic_id', 'files.message_id',

files.message_id is not the topic id, but the id of the reply itself, phpbb 3.2.3 responds with a 'You are not authorised to download this attachment.' when trying to download or view it. Changing the topic_id of an affected attachment in the phpbb_attachments table to the correct topic id fixes the broken attachment link.

camel1cz commented 6 years ago

Ah, you are right. Can you tell me, what code you used to convert the attachments correctly? I don't have environment to test any changes so I just trust you. Thanks for your help!

classofoutcasts commented 6 years ago

I made a small post conversion script for it too as I don't have time to work on the broader context your conversion script is 'living' in. I pulled the correct topic_id and user_id (user id's for attachments were mostly garbled as well) from phpbb_posts with the post_msg_id to find the correct topic_id and poster_id for each record in phpbb_attachments, where I did an update on each record.