MyBB Community Forums

Full Version: Merge System failing at some attachments
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Importing attachments sometimes fails with an sql error, I believe it was "Check your mysql syntax near SELECT tid FROM posts WHERE pid ="

Fixed for me if you add an empty-string safety check at boards/mybb/attachments.php line 85: if ($insert_data['pid'] == "") $insert_data['pid'] = 0;

Sorry for the low effort in investigation and description, I forgot to copy the actual error message or make a screenshot and it's complicated for me to reproduce.

EDIT: Turns out this is the same error, though importing from a different forum: http://community.mybb.com/thread-178862.html
So this error seems to be duplicated over several (all?) import scripts
Exactly, that issue can be triggered by all softwares with orphaned attachments.