What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

Support Bug Fixed Users Unable to Purchase After Updating to Latest Marketplace Version

VisEntities

Active Member
After updating to the latest version of the marketplace, users are no longer able to make purchases, they get an error when trying to buy
No outdated templates, all merged

image.png

In the server error log, this message shows up:
Code:
Server error log
XF\Db\Exception: MySQL query error [1264]: Out of range value for column 'xfa_rmmp_user_licenses' at row 1 src/XF/Db/AbstractStatement.php:230
Generated by: magnumk Apr 5, 2025 at 6:32 AM
Stack trace
UPDATE  `xf_user` SET `xfa_rmmp_user_licenses` = ? WHERE `user_id` = 44
------------

#0 src/XF/Db/Mysqli/Statement.php(207): XF\Db\AbstractStatement->getException('MySQL query err...', 1264, '22003')
#1 src/XF/Db/Mysqli/Statement.php(83): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1264, '22003')
#2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(323): XF\Db\AbstractAdapter->query('UPDATE  `xf_use...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1406): XF\Db\AbstractAdapter->update('xf_user', Array, '`user_id` = 44')
#5 src/addons/XFA/RMMarketplace/Entity/License.php(183): XF\Mvc\Entity\Entity->fastUpdate('xfa_rmmp_user_l...', -1)
#6 src/XF/Mvc/Entity/Entity.php(1324): XFA\RMMarketplace\Entity\License->_postSave()
#7 src/XF/Mvc/Entity/Entity.php(1318): XF\Mvc\Entity\Entity->save(true, false)
#8 src/XF/Mvc/Entity/Entity.php(1318): XF\Mvc\Entity\Entity->save(true, false)
#9 src/addons/XFA/RMMarketplace/Service/Order/Create.php(283): XF\Mvc\Entity\Entity->save(true, false)
#10 src/XF/Service/ValidateAndSavableTrait.php(42): XFA\RMMarketplace\Service\Order\Create->_save()
#11 src/addons/XFA/RMMarketplace/Helper/Purchase.php(176): XFA\RMMarketplace\Service\Order\Create->save()
#12 src/addons/XFA/RMMarketplace/Purchasable/MarketplacePurchase.php(62): XFA\RMMarketplace\Helper\Purchase->processPurchaseCreation(Object(XF\Http\Request), 'paid_xf', '', Array, NULL)
#13 src/addons/XFA/RMMarketplaceCart/XFA/RMMarketplace/Purchasable/MarketplacePurchase.php(28): XFA\RMMarketplace\Purchasable\MarketplacePurchase->getPurchaseFromRequest(Object(XF\Http\Request), Object(XFRM\XF\Entity\User), NULL)
#14 src/XF/Pub/Controller/PurchaseController.php(26): XFA\RMMarketplaceCart\XFA\RMMarketplace\Purchasable\MarketplacePurchase->getPurchaseFromRequest(Object(XF\Http\Request), Object(XFRM\XF\Entity\User), NULL)
#15 src/XF/Mvc/Dispatcher.php(362): XF\Pub\Controller\PurchaseController->actionIndex(Object(XF\Mvc\ParameterBag))
#16 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Purchase', 'Index', Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\PurchaseController), NULL)
#17 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\PurchaseController), NULL)
#18 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#19 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#20 src/XF.php(806): XF\App->run()
#21 index.php(23): XF::runApp('XF\\Pub\\App')
#22 {main}
Request state
array(4) {
  ["url"] => string(44) "/purchase/xfa_rmmp_purchase/?resource_id=222"
  ["referrer"] => string(48) "https://game4freak.io/plugins/portable-fort.222/"
  ["_GET"] => array(2) {
    ["/purchase/xfa_rmmp_purchase/"] => string(0) ""
    ["resource_id"] => string(3) "222"
  }
  ["_POST"] => array(8) {
    ["_xfToken"] => string(8) "********"
    ["coupon_code"] => string(0) ""
    ["payment_profile_id"] => string(1) "4"
    ["xfa_agree"] => string(1) "1"
    ["for_username"] => string(0) ""
    ["_xfResponseType"] => string(4) "json"
    ["_xfWithData"] => string(1) "1"
    ["_xfRequestUri"] => string(27) "/plugins/portable-fort.222/"
  }
}
1743831424943.png
 
That was on a purchase ? Because I see -1, will check and fix right after breakfast sorry for the inconvenience.
 
I did not encountered that error during my tests that's very strange.
Anyways I'll release a fix that should correct the issue.
 
Yeah, I believe it only happened to user with 0 license before, hence why I didn't see it.
 
The license page condition has changed as I have added a new field to count licenses to cope with the purchase for a friend issue.
The licenses count is expected to be rebuilt upon install so it's strange, unless it failed.

Did you have errors in the logs right after the upgrade ?

The rebuild process is ran again in 5.8.1 so please install this and check if you see it.
 
Allright, it should be fine now, not sure why you didn't have it prior to that upgrade.

Can you please check if you see an error in the log from around the installation time as well as:
  • If the resource revenue total is fine (as a matter of fact without the discount accounted as there is an open bug for that) ?
  • The number of items in orders is correctly displayed in the orders list ?
  • The payment provider is correctly shown for previous orders ?

Just to make sure the whole upgrade jobs were ran when you updated.
 
Not entirely, I noticed it was fixed for the parent resource, but children not
The parent/child has no impact on revenue computation.
What do you mean by not fixed ? It's not showing a correct revenue ? or none ?

By the way, I noticed the shopping cart button disappeared
I have it enabled didn't change anything

View attachment 7198
It's fine on my side, please check you don't have modified templates that would require to be reverted.
 
If you meant the Gross in statistics that it was including full resource price instead of discounted, it's not fixed
 
It's fine on my side, please check you don't have modified templates that would require to be reverted.
No modified templates at all, in both Marketplace and Cart, I double checked, I rebuilt Cart addon again also but still not showing up
 
For the purchases number, a sale with a free coupon is still considered as a purchase.

The discounted price is not fixed in that version as I stated in the bug report.
It needs further changes to how coupons are handled and I didn't put it in that version batch as it wasn't considered a critical issue.

Please check in the template modifications if all are applied (for the cart).
On my side they are :
Capture d’écran 2025-04-05 à 10.55.38.png
 

From bespoke add-on development to complex integrations and specialized enhancements, we offer a range of XenForo development services designed to help your community thrive.

Start discussing your needs
Back
Top
Cart