fearmywrench
Member
These errors occur when adding a purchase to a user via the Add Purchase function in the Purchases section of the Shop Admin CP. I have tested a few different scenarios including different item types, different users, active or inactive, gift or no gift, gift message or no gift message with error occurring in every scenario. The purchase is not added.
Error: Call to a member function setPurchase() on null src/addons/DBTech/Shop/Entity/Purchase.php:218
Generated by: Apr 9, 2019 at 2:37 AM
Stack trace
Request state
---
ErrorException: [E_NOTICE] Trying to get property of non-object src/addons/DBTech/Shop/Entity/Purchase.php:217
Generated by: Apr 9, 2019 at 2:37 AM
Stack trace
Request state
Error: Call to a member function setPurchase() on null src/addons/DBTech/Shop/Entity/Purchase.php:218
Generated by: Apr 9, 2019 at 2:37 AM
Stack trace
Code:
#0 src/XF/Mvc/Entity/Entity.php(148): DBTech\Shop\Entity\Purchase->getHandler()
#1 src/XF/Mvc/Entity/Entity.php(101): XF\Mvc\Entity\Entity->get('handler')
#2 src/addons/DBTech/Shop/Admin/Controller/Purchase.php(303): XF\Mvc\Entity\Entity->__get('handler')
#3 src/addons/DBTech/Shop/Admin/Controller/Purchase.php(347): DBTech\Shop\Admin\Controller\Purchase->purchaseSaveProcess(Object(DBTech\Shop\Entity\Purchase))
#4 src/XF/Mvc/Dispatcher.php(321): DBTech\Shop\Admin\Controller\Purchase->actionSave(Object(XF\Mvc\ParameterBag))
#5 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('DBTech\\Shop:pur...', 'Save', Object(XF\Mvc\RouteMatch), Object(DBTech\Shop\Admin\Controller\Purchase), NULL)
#6 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(DBTech\Shop\Admin\Controller\Purchase), NULL)
#7 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#8 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#9 src/XF.php(390): XF\App->run()
#10 admin.php(13): XF::runApp('XF\\Admin\\App')
#11 {main}
Request state
Code:
array(4) {
["url"] => string(49) "/admin.php?dbtech-shop/purchases/0/save&item_id=1"
["referrer"] => string(69) "http://siteurl.com/admin.php?dbtech-shop/purchases/add"
["_GET"] => array(2) {
["dbtech-shop/purchases/0/save"] => string(0) ""
["item_id"] => string(1) "1"
}
["_POST"] => array(10) {
["username"] => string(9) "User Test"
["message"] => string(0) ""
["active"] => string(1) "1"
["purchase_date"] => string(10) "2019-04-09"
["purchase_time"] => string(5) "02:37"
["length_type"] => string(9) "permanent"
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(36) "/admin.php?dbtech-shop/purchases/add"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
---
ErrorException: [E_NOTICE] Trying to get property of non-object src/addons/DBTech/Shop/Entity/Purchase.php:217
Generated by: Apr 9, 2019 at 2:37 AM
Stack trace
Code:
#0 src/addons/DBTech/Shop/Entity/Purchase.php(217): XF::handlePhpError(8, '[E_NOTICE] Tryi...', '/home/skybound/...', 217, Array)
#1 src/XF/Mvc/Entity/Entity.php(148): DBTech\Shop\Entity\Purchase->getHandler()
#2 src/XF/Mvc/Entity/Entity.php(101): XF\Mvc\Entity\Entity->get('handler')
#3 src/addons/DBTech/Shop/Admin/Controller/Purchase.php(303): XF\Mvc\Entity\Entity->__get('handler')
#4 src/addons/DBTech/Shop/Admin/Controller/Purchase.php(347): DBTech\Shop\Admin\Controller\Purchase->purchaseSaveProcess(Object(DBTech\Shop\Entity\Purchase))
#5 src/XF/Mvc/Dispatcher.php(321): DBTech\Shop\Admin\Controller\Purchase->actionSave(Object(XF\Mvc\ParameterBag))
#6 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('DBTech\\Shop:Pur...', 'Save', Object(XF\Mvc\RouteMatch), Object(DBTech\Shop\Admin\Controller\Purchase), NULL)
#7 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(DBTech\Shop\Admin\Controller\Purchase), NULL)
#8 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#10 src/XF.php(390): XF\App->run()
#11 admin.php(13): XF::runApp('XF\\Admin\\App')
#12 {main}
Request state
Code:
array(4) {
["url"] => string(49) "/admin.php?dbtech-shop/purchases/0/save&item_id=1"
["referrer"] => string(69) "http://siteurl.com/admin.php?dbtech-shop/purchases/add"
["_GET"] => array(2) {
["dbtech-shop/purchases/0/save"] => string(0) ""
["item_id"] => string(1) "1"
}
["_POST"] => array(10) {
["username"] => string(9) "User Test"
["message"] => string(0) ""
["active"] => string(1) "1"
["purchase_date"] => string(10) "2019-04-09"
["purchase_time"] => string(5) "02:37"
["length_type"] => string(9) "permanent"
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(36) "/admin.php?dbtech-shop/purchases/add"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
Last edited: