Data at Your Fingertips: Explore Our New Reporting and Statistical Capabilities By Ryan Ashbrook Tuesday at 01:29 PM
Solution RangeMachine Posted June 12, 2021 Solution Share Posted June 12, 2021 (edited) After upgrade to IPS 4.6 my customers are not able to purchase/renew/etc any item. OutOfRangeException: (0) #0 /var/www/censored/applications/nexus/modules/front/checkout/checkout.php(1176): IPS\Patterns\_ActiveRecord::load() #1 /var/www/censored/system/Helpers/Wizard/Wizard.php(181): IPS\nexus\modules\front\checkout\_checkout->_pay() #2 /var/www/censored/applications/nexus/modules/front/checkout/checkout.php(170): IPS\Helpers\_Wizard->__toString() #3 /var/www/censored/system/Dispatcher/Controller.php(101): IPS\nexus\modules\front\checkout\_checkout->manage() #4 /var/www/censored/applications/nexus/modules/front/checkout/checkout.php(57): IPS\Dispatcher\_Controller->execute() #5 /var/www/censored/system/Dispatcher/Dispatcher.php(153): IPS\nexus\modules\front\checkout\_checkout->execute() #6 /var/www/censored/index.php(13): IPS\_Dispatcher->run() #7 {main} Theres part of code from applications\nexus\modules\front\checkout\checkout.php (line 1171) file: /* Verify stock level one last time. It's possible someone added an item to their cart, then someone else did and checked out and the stock level is now 0. */ foreach ( $this->invoice->items as $item ) { if( $item->appKey == 'nexus' AND $item->typeKey == 'package' ) { $package = \IPS\nexus\Package::load( $item->id ); $data = $package->optionValuesStockAndPrice( $package->optionValues( $item->details ) ); if ( $data['stock'] != -1 and $data['stock'] < $item->quantity ) { \IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack( 'not_enough_in_stock_checkout', FALSE, array( 'pluralize' => array( $data['stock'] ), 'sprintf' => array( $item->name ) ) ), '1X196/G', 403, '' ); } } } From what I can see $package = \IPS\nexus\Package::load( $item->id ); tries to load Package with purchase id, eg \IPS\nexus\Package::load( 672 ) in my case for my profile and of course it fails because theres no package with 672 id. Commenting this code fixes the problem. I guess it should use package id instead of purchase id, but I personally have no idea how to get package id from invoice.UPDATE: IPS support confirmed bug and it will be fixed in the next update. Edited June 16, 2021 by RangeMachine Link to comment Share on other sites More sharing options...
Nathan Explosion Posted June 12, 2021 Share Posted June 12, 2021 Log a ticket with support to get this checked. Link to comment Share on other sites More sharing options...
RangeMachine Posted June 12, 2021 Author Share Posted June 12, 2021 5 minutes ago, Nathan Explosion said: Log a ticket with support to get this checked. Will do. Nathan Explosion 1 Link to comment Share on other sites More sharing options...
Recommended Posts