DragonByte Tech
Well-known member
InvalidArgumentException: Column 'resource_id' is read only, can only be set with forceSet in src/XF/Mvc/Entity/Entity.php at line 550
- XF\Mvc\Entity\Entity->set() insrc/addons/DBTech/T2WRailsImport/Import/Data/Book.php at line 87
- DBTech\T2WRailsImport\Import\Data\Book->preSave() insrc/XF/Import/Data/AbstractData.php at line 112
- XF\Import\Data\AbstractData->save() insrc/XF/Import/Data/AbstractEntityData.php at line 77
- XF\Import\Data\AbstractEntityData->save() insrc/addons/DBTech/T2WRailsImport/Import/Importer/ResourceManager.php at line 728
- DBTech\T2WRailsImport\Import\Importer\ResourceManager->stepBooks() in src/XF/Import/Runner.php at line 160
- XF\Import\Runner->runStep() in src/XF/Import/Runner.php at line 74
- XF\Import\Runner->run() in src/XF/Admin/Controller/Import.php at line232
- XF\Admin\Controller\Import->actionRun() in src/XF/Mvc/Dispatcher.phpat line 249
- XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
- XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
- XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
- XF\App->run() in src/XF.php at line 329
- XF::runApp() in admin.php at line 13
Fix:
In AbstractEntityData find:
PHP:
$this->entity->set($primaryKey, $oldId);
PHP:
$this->entity->set($primaryKey, $oldId, ['forceSet' => true]);
(The stack trace shows my custom importer data class instead of
AbstractEntityData
because I had to copy the preSave
function to fix the retainIds
bug below.)Fillip