Bug Errors when adding Purchase to user in Admin CP

Status
Not open for further replies.
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
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:
That's due to the configuration change from a previous build, I've resolved it locally and I'll resolve it on the test site in a future build.
 
Hello @fearmywrench,

We hope your ticket regarding DragonByte Shop has been addressed to your satisfaction. This ticket has now been closed.

If your ticket has not been resolved, you can reply to this thread at any point in the next 7 days in order to reopen the ticket, afterwards this thread will be closed.

Please do not reply to this thread if your ticket has been resolved.

Thank you.


- DragonByte Technologies, Ltd.
 
Status
Not open for further replies.

DragonByte Shop

XenForo 1.5.3+ XenForo 2.0.x XenForo 2.1.x XenForo 2.2.x XenForo 2.3.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
3,371
Customer rating
5.00 star(s) 3 ratings
Back
Top