Fixed \XF\Import\Data\AbstractEntityData :: preSave - retainIds call is wrong

DragonByte Tech

Well-known member
ErrorException: [E_USER_WARNING] Accessed unknown getter 'handler' on XFRM:ResourceItem[unsaved] in src/XF/Mvc/Entity/Entity.php at line 178
  1. XF::handlePhpError()
  2. trigger_error() in src/XF/Mvc/Entity/Entity.php at line 178
  3. XF\Mvc\Entity\Entity->get() insrc/XF/Import/Data/AbstractEntityData.php at line 46
  4. XF\Import\Data\AbstractEntityData->get() insrc/XF/Import/Data/AbstractData.php at line 298
  5. XF\Import\Data\AbstractData->__get() insrc/XF/Import/Data/AbstractEntityData.php at line 55
  6. XF\Import\Data\AbstractEntityData->preSave() insrc/addons/DBTech/T2WRailsImport/Import/Data/Book.php at line 78
  7. DBTech\T2WRailsImport\Import\Data\Book->preSave() insrc/XF/Import/Data/AbstractData.php at line 112
  8. XF\Import\Data\AbstractData->save() insrc/XF/Import/Data/AbstractEntityData.php at line 77
  9. XF\Import\Data\AbstractEntityData->save() insrc/addons/DBTech/T2WRailsImport/Import/Importer/ResourceManager.php at line 722
  10. DBTech\T2WRailsImport\Import\Importer\ResourceManager->stepBooks() in src/XF/Import/Runner.php at line 160
  11. XF\Import\Runner->runStep() in src/XF/Import/Runner.php at line 74
  12. XF\Import\Runner->run() in src/XF/Admin/Controller/Import.php at line232
  13. XF\Admin\Controller\Import->actionRun() in src/XF/Mvc/Dispatcher.phpat line 249
  14. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  15. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  16. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
  17. XF\App->run() in src/XF.php at line 329
  18. XF::runApp() in admin.php at line 13

Fix:
in AbstractEntityData find:
PHP:
if ($this->handler->retainIds() && $oldId !== false)

Replace with:
PHP:
if ($this->retainIds() && $oldId !== false)


Fillip
 
Back
Top Bottom