Fixed  Import problem: Out of range value adjusted for column 'attach_count' at row 1


Well-known member
I was almost done with the first test import, this happened during the import of attachments, it keeps showing when I return to the import page.
Server Error

Mysqli statement execute error : Out of range value adjusted for column 'attach_count' at row 1

Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in XenForo/Model/Import.php at line 1023
XenForo_Model_Import->importPostAttachment() in XenForo/Importer/vBulletin.php at line 2089
XenForo_Importer_vBulletin->stepAttachments() in XenForo/Importer/Abstract.php at line 77
XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 161
XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 105
XenForo_ControllerAdmin_Import->actionImport() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /home/xxxx/domains/ at line 13


XenForo developer
Staff member
The counter in vB was probably wrong, or you have 65000 attachments to one post. :)

I actually found 2 minor bugs here - the attach count code in the import is wrong.

In library/XenForo/Importer/vBulletin.php, you should change:
'attach_count' => $post['attach'],
'attach_count' => 0,
Then in library/XenForo/Model/Import.php, change:
attach_count = attach_count + 1
attach_count = IF(attach_count < 65535, attach_count + 1, 65535)
The second change will prevent this error. The only way for the counts to be right (and there was a bug in XF that caused them to be wrong before as well) is to do a fresh import.