2010-09-22, 05:32 PM
This is the OP from the thread references in the first post. Been away for a while, but recently came back to give this another try. This time, to rule out Mac-specific issues, I'm doing the merge on an Ubuntu 10.04 box. I am running MyBB 1.6 and merge 1.6.0. And I continue to have the very same issues as before (see here: http://community.mybb.com/thread-68812.html )
This time, however, the progress pages provide a little more insight, perhaps. The problem seems to be with mime_content_type(), as I get the following error for each attachment:
Where "jpg_thumb" in the first varies with the filename extension in the SMF attachments table (i.e., it will take the value "jpg", "png", "jpg_thumb", etc). Just a guess, but it looks like the attachements merge function is munging the filename somehow?
Indeed, looking at the file, you are only passing the file extension to mime_content_type, and mime_content_type requries the full filename with path! Looks an easy fix…
Quick update: Replaced line 123 of boards/smf/attachments.php with
And still got errors: At this point in the execution, $import_session['uploadspath'] is empty!
Unsure how best to proceed at this point.
This time, however, the progress pages provide a little more insight, perhaps. The problem seems to be with mime_content_type(), as I get the following error for each attachment:
Warning [2] mime_content_type(): File or path not found 'jpg_thumb' -
Line: 123 - File: convert/boards/smf/attachments.php PHP 5.3.2-1ubuntu4.5 (Linux)
File Line Function
[PHP] errorHandler->error
/convert/boards/smf/attachments.php 123 mime_content_type
/convert/resources/modules/attachments.php 39 SMF_Converter_Module_Attachments->convert_data
/convert/boards/smf/attachments.php 98 Converter_Module_Attachments->insert
/convert/index.php 970 SMF_Converter_Module_Attachments->import
Where "jpg_thumb" in the first varies with the filename extension in the SMF attachments table (i.e., it will take the value "jpg", "png", "jpg_thumb", etc). Just a guess, but it looks like the attachements merge function is munging the filename somehow?
Indeed, looking at the file, you are only passing the file extension to mime_content_type, and mime_content_type requries the full filename with path! Looks an easy fix…
Quick update: Replaced line 123 of boards/smf/attachments.php with
$insert_data['filetype'] = mime_content_type($import_session['uploadspath'].'/'.$data['filename']);
And still got errors: At this point in the execution, $import_session['uploadspath'] is empty!
Warning [2] mime_content_type(): File or path not found '/bus11-3.jpg' - Line: 123 - File: convert/boards/smf/attachments.php PHP 5.3.2-1ubuntu4.5 (Linux)
File Line Function
[PHP] errorHandler->error
/convert/boards/smf/attachments.php 123 mime_content_type
/convert/resources/modules/attachments.php 39 SMF_Converter_Module_Attachments->convert_data
/convert/boards/smf/attachments.php 98 Converter_Module_Attachments->insert
/convert/index.php 970 SMF_Converter_Module_Attachments->import
Unsure how best to proceed at this point.