Steffen
Well-known member
- Affected version
- 2.0.0
Code:
$ php cmd.php xf:import --verbose
Starting import from vBulletin 4.x (Beta)...
- [...]
- Step 10 of 19: Moderators - 100.00% (< 1 sec)
[XF\Db\Exception]
MySQL query error [1366]: Incorrect integer value: 'howto_faq' for column 'prefix_group_id' at row 1
Exception trace:
() at src/XF/Db/AbstractStatement.php:212
XF\Db\AbstractStatement->getException() at src/XF/Db/Mysqli/Statement.php:174
XF\Db\Mysqli\Statement->getException() at src/XF/Db/Mysqli/Statement.php:69
XF\Db\Mysqli\Statement->execute() at src/XF/Db/AbstractAdapter.php:69
XF\Db\AbstractAdapter->query() at src/XF/Db/AbstractAdapter.php:145
XF\Db\AbstractAdapter->insert() at src/XF/Import/Data/EntityEmulator.php:207
XF\Import\Data\EntityEmulator->insert() at src/XF/Import/Data/AbstractEmulatedData.php:34
XF\Import\Data\AbstractEmulatedData->write() at src/XF/Import/Data/AbstractData.php:99
XF\Import\Data\AbstractData->save() at src/XF/Import/Importer/vBulletin.php:2193
XF\Import\Importer\vBulletin->stepThreadPrefixes() at src/XF/Import/Runner.php:161
XF\Import\Runner->runStep() at src/XF/Import/Runner.php:75
XF\Import\Runner->run() at src/XF/Cli/Command/Import.php:64
XF\Cli\Command\Import->execute() at src/vendor/symfony/console/Command/Command.php:242
Symfony\Component\Console\Command\Command->run() at src/vendor/symfony/console/Application.php:843
Symfony\Component\Console\Application->doRunCommand() at src/vendor/symfony/console/Application.php:194
Symfony\Component\Console\Application->doRun() at src/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at src/XF/Cli/Runner.php:63
XF\Cli\Runner->run() at cmd.php:15
xf:import
I'm not sure whether the following patch is the correct way to fix this:
Diff:
diff --git a/xenforo/src/XF/Import/Importer/vBulletin.php b/xenforo/src/XF/Import/Importer/vBulletin.php
--- a/xenforo/src/XF/Import/Importer/vBulletin.php
+++ b/xenforo/src/XF/Import/Importer/vBulletin.php
@@ -2190,7 +2190,7 @@ class vBulletin extends AbstractForumImporter
$importGroup->display_order = $prefixSet['displayorder'];
$importGroup->setTitle($this->convertToUtf8($prefixSet['title']));
- if ($newGroupId = $importGroup->save($oldGroupId))
+ if ($newGroupId = $importGroup->save(false))
{
$mappedGroupIds[$oldGroupId] = $newGroupId;
}
@@ -2256,7 +2256,7 @@ class vBulletin extends AbstractForumImporter
$importPrefix->setNodes($prefixNodes[$prefixSetId]);
}
- if ($importPrefix->save($oldPrefixId))
+ if ($importPrefix->save(false))
{
$state->imported++;
}