numero2 / contao-isotope-simple-erp

Most basic ERP system for Isotope eCommerce.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception on payment

gintabln opened this issue · comments

Thank you for this erp,
I receive an error on checkout (Contao 3.5.27 and Isotope 2.4.1. :

Fatal error: Uncaught exception LogicException with message The model instance has been detached and cannot be saved thrown in system/modules/core/library/Contao/Model.php on line 434

#0 system/modules/isotope_simple_erp/classes/SimpleERP.php(56): Contao\Model->save()
#1 system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php(224): numero2\IsotopeSimpleERP\SimpleERP->updateProductCount(Object(Isotope\Model\ProductCollection\Order), Array)
#2 system/modules/isotope/library/Isotope/Model/Payment/Cash.php(38): Isotope\Model\ProductCollection\Order->checkout()
#3 system/modules/isotope/library/Isotope/Module/Checkout.php(165): Isotope\Model\Payment\Cash->processPayment(Object(Isotope\Model\ProductCollection\Order), Object(Isotope\Module\Checkout))
#4 system/modules/core/modules/Module.php(287): Isotope\Module\Checkout->compile()
#5 system/modules/haste/library/Haste/Frontend/AbstractFrontendModule.php(52): Contao\Module->generate()
#6 system/modules/isotope/library/Isotope/Module/Module.php(111): Haste\Frontend\AbstractFrontendModule->generate()
#7 system/modules/isotope/library/Isotope/Module/Checkout.php(109): Isotope\Module\Module->generate()
#8 system/modules/core/elements/ContentModule.php(59): Isotope\Module\Checkout->generate()
#9 system/modules/core/library/Contao/Controller.php(484): Contao\ContentModule->generate()
#10 system/modules/core/modules/ModuleArticle.php(213): Contao\Controller::getContentElement(Object(Contao\ContentModel), 'main')
#11 system/modules/core/modules/Module.php(287): Contao\ModuleArticle->compile()
#12 system/modules/core/modules/ModuleArticle.php(67): Contao\Module->generate()
#13 system/modules/core/library/Contao/Controller.php(417): Contao\ModuleArticle->generate(false)
#14 system/modules/core/library/Contao/Controller.php(277): Contao\Controller::getArticle(Object(Contao\ArticleModel), false, false, 'main')
#15 system/modules/core/pages/PageRegular.php(133): Contao\Controller::getFrontendModule('0', 'main')
#16 system/modules/core/controllers/FrontendIndex.php(285): Contao\PageRegular->generate(Object(Contao\PageModel), true)
#17 index.php(20): Contao\FrontendIndex->run()
#18 {main}
How can I fix it?
Thank you.

It seems like this problem is related to a "recent" change in Isotopes postCheckout-Hook (see isotope/core#1756). We'll need to update the product by a simple query rather than using the product model. I'll look into this as soon as I can. If this is an urgent for you please feel free to contact us directly on http://www.numero2.de/kontakt.html

Please checkout the latest isotope-2.4.1 branch. As soon as we have this version successfully running in a production project we will add it to composer for further use.