[DBTech] DragonByte eCommerce

[DBTech] DragonByte eCommerce [Paid] 5.1.2

No permission to buy (€29.95)
DragonByte Tech updated [DBTech] DragonByte eCommerce with a new update entry:

5.1.1

Update highlights​

This version improves performance when guest orders are enabled, and (finally) fixes a long-standing issue preventing recurring sales from resetting correctly.


Complete Change Log​

Change: Improve performance for fetching guest orders
Fix: Fix potential server errors when fetching the cart item counter for guest users
Fix: The "Recurring" configuration would be lost when creating or saving sales
Fix: Fix...

Read the rest of this update entry...
 
DragonByte Tech updated [DBTech] DragonByte eCommerce with a new update entry:

5.1.2

Update highlights​

This version fixes a few issues reported by the community, including a critical fix preventing Classifieds orders from being taken due to incorrect payment profile references.


Complete Change Log​

Fix: Fix server error preventing a fresh install from completing
Fix: Fix "Retry payment" being an option for orders not yet awaiting payment
Fix: Fix checkout screen not working correctly for Classifieds orders

Read the rest of this update entry...
 
Hello,

With the latest update, I get this error when I try to add a download:

  • TypeError: DBTech\eCommerce\Download\AbstractHandler::isUsableInProduct(): Argument #1 ($product) must be of type DBTech\eCommerce\Entity\Product, null given, called in /home/xxxxxxxxxxx/www/src/addons/DBTech/eCommerce/Admin/Controller/DownloadController.php on line 278
  • src/addons/DBTech/eCommerce/Download/AbstractHandler.php:65
#0 src/addons/DBTech/eCommerce/Admin/Controller/DownloadController.php(278): DBTech\eCommerce\Download\AbstractHandler->isUsableInProduct(NULL)
#1 src/XF/Mvc/Dispatcher.php(362): DBTech\eCommerce\Admin\Controller\DownloadController->actionAdd(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('DBTech\\eCommerc...', 'Add', Object(XF\Mvc\RouteMatch), Object(DBTech\eCommerce\Admin\Controller\DownloadController), NULL)
#3 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(DBTech\eCommerce\Admin\Controller\DownloadController), NULL)
#4 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#6 src/XF.php(806): XF\App->run()
#7 admin.php(15): XF::runApp('XF\\Admin\\App')
#8 {main}
array(4) {
["url"] => string(192) "/admin.php?dbtech-ecommerce/downloads/add&_xfResponseType=json&_xfWithData=1&_xfRequestUri=%2Fadmin.php%3Fdbtech-ecommerce%2Fdownloads%2F&_xfToken=1765926145%2Cbe6108f50b93e70e175fdf434e2a4c5d"
["referrer"] => string(58) "https://xxxxxxxxxxxx.com/admin.php?dbtech-ecommerce/downloads/"
["_GET"] => array(5) {
["dbtech-ecommerce/downloads/add"] => string(0) ""
["_xfResponseType"] => string(4) "json"
["_xfWithData"] => string(1) "1"
["_xfRequestUri"] => string(38) "/admin.php?dbtech-ecommerce/downloads/"
["_xfToken"] => string(43) "1765926145,be6108f50b93e70e175fdf434e2a4c5d"
}
["_POST"] => array(0) {
}
}

EDIT: I've done some testing and the problem has been occurring since version 5.0.0
 
Last edited:
To correct the error, I had to modify Download Controller.php by replacing:
PHP:
if ($handler->isEnabled() && $handler->isUsableInProduct($product))
And replace it with:
PHP:
if ($handler->isEnabled() && (!$product || $handler->isUsableInProduct($product)))
 
To correct the error, I had to modify Download Controller.php by replacing:
PHP:
if ($handler->isEnabled() && $handler->isUsableInProduct($product))
And replace it with:
PHP:
if ($handler->isEnabled() && (!$product || $handler->isUsableInProduct($product)))
Sorry for the delay in getting back to you, I have been out of the office.

I've hotfixed v5.1.2 with your change plus a few other changes to better validate the handler usable check. Thanks!
 
Back
Top Bottom