Fixed Gallery import from Invision

Affected version
Importer v1.3 XF v2.1.6

ibaker

Well-known member
Trying to import to a clean (no data) XF from Invision v4.4.9.2 and the forums import without an error but when trying to then import the Gallery into XF Media Gallery I get an error:
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '1' for key 'PRIMARY' in src\XF\Db\AbstractStatement.php at line 228

  1. XF\Db\AbstractStatement->getException() in src\XF\Db\Mysqli\Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src\XF\Db\Mysqli\Statement.php at line 77
  3. XF\Db\Mysqli\Statement->execute() in src\XF\Db\AbstractAdapter.php at line 94
  4. XF\Db\AbstractAdapter->query() in src\XF\Db\AbstractAdapter.php at line 221
  5. XF\Db\AbstractAdapter->insert() in src\XF\Import\Data\EntityEmulator.php at line 326
  6. XF\Import\Data\EntityEmulator->insert() in src\XF\Import\Data\AbstractEmulatedData.php at line 55
  7. XF\Import\Data\AbstractEmulatedData->write() in src\XF\Import\Data\AbstractData.php at line 127
  8. XF\Import\Data\AbstractData->save() in src\addons\XFMG\Import\Importer\IpsGallery.php at line 378
  9. XFMG\Import\Importer\IpsGallery->stepMediaItems() in src\XF\Import\Runner.php at line 231
  10. XF\Import\Runner->runStep() in src\XF\Import\Runner.php at line 59
  11. XF\Import\Runner->run() in src\XF\Admin\Controller\Import.php at line 234
  12. XF\Admin\Controller\Import->actionRun() in src\XF\Mvc\Dispatcher.php at line 350
  13. XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 261
  14. XF\Mvc\Dispatcher->dispatchFromMatch() in src\XF\Mvc\Dispatcher.php at line 113
  15. XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 55
  16. XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2184
  17. XF\App->run() in src\XF.php at line 391
  18. XF::runApp() in admin.php at line 13
Hit the back arrow and it is stuck on "Step 2 of 8: Albums - 100%"
 

Chris D

XenForo developer
Staff member
Trying to import to a clean (no data) XF from Invision v4.4.9.2 and the forums import without an error but when trying to then import the Gallery into XF Media Gallery I get an error:
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '1' for key 'PRIMARY' in src\XF\Db\AbstractStatement.php at line 228

  1. XF\Db\AbstractStatement->getException() in src\XF\Db\Mysqli\Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src\XF\Db\Mysqli\Statement.php at line 77
  3. XF\Db\Mysqli\Statement->execute() in src\XF\Db\AbstractAdapter.php at line 94
  4. XF\Db\AbstractAdapter->query() in src\XF\Db\AbstractAdapter.php at line 221
  5. XF\Db\AbstractAdapter->insert() in src\XF\Import\Data\EntityEmulator.php at line 326
  6. XF\Import\Data\EntityEmulator->insert() in src\XF\Import\Data\AbstractEmulatedData.php at line 55
  7. XF\Import\Data\AbstractEmulatedData->write() in src\XF\Import\Data\AbstractData.php at line 127
  8. XF\Import\Data\AbstractData->save() in src\addons\XFMG\Import\Importer\IpsGallery.php at line 378
  9. XFMG\Import\Importer\IpsGallery->stepMediaItems() in src\XF\Import\Runner.php at line 231
  10. XF\Import\Runner->runStep() in src\XF\Import\Runner.php at line 59
  11. XF\Import\Runner->run() in src\XF\Admin\Controller\Import.php at line 234
  12. XF\Admin\Controller\Import->actionRun() in src\XF\Mvc\Dispatcher.php at line 350
  13. XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 261
  14. XF\Mvc\Dispatcher->dispatchFromMatch() in src\XF\Mvc\Dispatcher.php at line 113
  15. XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 55
  16. XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2184
  17. XF\App->run() in src\XF.php at line 391
  18. XF::runApp() in admin.php at line 13
Hit the back arrow and it is stuck on "Step 2 of 8: Albums - 100%"
This is fixed for the next release, thanks for reporting. If you want to/need to patch it yourself before your import then in the file src/addons/XFMG/Import/Importer/IpsGallery.php find:

PHP:
$albumImport->log(false);
And replace with:
PHP:
$albumImport->preventRetainIds();
$albumImport->log(false);
 

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XFMG release (2.1.7).

Change log:
Prevent retaining IDs in a few gallery importers related to additional albums the importer creates for organizational purposes.
There may be a delay before changes are rolled out to the XenForo Community.
 
Top