Chandra Posted November 8, 2017 Share Posted November 8, 2017 Hi, Just migrated to TB and am getting this error when a new user account is created. Kindly give me a hand. ``` [ThirtyBeesDatabaseException] BIGINT UNSIGNED value is out of range in '(xxc_tdb.s.id_sponsor - 361)' SELECT s.* FROM ps_referralprogram s WHERE (s.id_sponsor - 361) at line 808 in file classes/db/Db.php 803. if ($webserviceCall && $errno) { 804. $dbg = debugbacktrace(); 805. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97); 806. } elseif (PSDEBUGSQL_ && $errno && !defined('TBINSTALLATIONIN_PROGRESS')) { 807. if ($sql) { 808. throw new PrestaShopDatabaseException($this->getMsgError().''.$sql.''); 809. } 810. 811. throw new PrestaShopDatabaseException($this->getMsgError()); 812. } 813. } DbCore->displayError - [line 460 - classes/db/Db.php] - [1 Arguments] DbCore->query - [line 673 - classes/db/Db.php] - [1 Arguments] DbCore->executeS - [line 91 - modules/referralprogram/ReferralProgramModule.php] - [1 Arguments] ReferralProgramModule::getSponsorFriend - [line 725 - modules/referralprogram/referralprogram.php] - [1 Arguments] ReferralProgram->hookAdminCustomers - [line 771 - classes/Hook.php] - [1 Arguments] HookCore::coreCallHook - [line 489 - classes/Hook.php] - [3 Arguments] HookCore::execWithoutCache - [line 280 - classes/Hook.php] - [7 Arguments] HookCore::exec - [line 211 - config/smarty.config.inc.php] - [3 Arguments] smartyHook - [line 274 - config/smarty.config.inc.php] - [2 Arguments] SmartyLazyRegister->__call - [line 856 - vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code] - [2 Arguments] content_5a033ff55220a7_84235799 - [line 188 - vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php] - [1 Arguments] Smarty_Internal_TemplateBase->fetch - [line 424 - classes/SmartyCustom.php] - [7 Arguments] Smarty_Custom_Template->fetch - [line 378 - classes/helper/Helper.php] HelperCore->generate - [line 83 - classes/helper/HelperView.php] HelperViewCore->generateView - [line 3054 - classes/controller/AdminController.php] AdminControllerCore->renderView - [line 997 - controllers/admin/AdminCustomersController.php] AdminCustomersControllerCore->renderView - [line 2420 - classes/controller/AdminController.php] AdminControllerCore->initContent - [line 244 - controllers/admin/AdminCustomersController.php] AdminCustomersControllerCore->initContent - [line 366 - classes/controller/Controller.php] ControllerCore->run - [line 743 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 58 - admin/index.php] ``` Link to comment Share on other sites More sharing options...
0 SLiCK_303 Posted November 8, 2017 Share Posted November 8, 2017 is your idsponsor in psreferralprogram an int(10) ? Link to comment Share on other sites More sharing options...
0 Chandra Posted November 8, 2017 Author Share Posted November 8, 2017 Yes Field name Type Allow nulls? Key Default value Extras id_referralprogram int(10) unsigned No Primary NULL auto_increment id_sponsor int(10) unsigned No None NULL email varchar(255) No None NULL lastname varchar(128) No None NULL firstname varchar(128) No None NULL id_customer int(10) unsigned Yes None NULL id_cart_rule int(10) unsigned Yes None NULL id_cart_rule_sponsor int(10) unsigned Yes None NULL date_add datetime No None NULL date_upd datetime No None NULL Link to comment Share on other sites More sharing options...
0 SLiCK_303 Posted November 8, 2017 Share Posted November 8, 2017 I'm clueless then, hopefully someone else can help. Link to comment Share on other sites More sharing options...
0 Chandra Posted November 9, 2017 Author Share Posted November 9, 2017 The first line below is the offending line 725 of referralprogram.php Is there anything obvious here? I am reading that the current versions of mysql have bigint/unsigned related changes. $friends = ReferralProgramModule::getSponsorFriend((int) $customer->id); if ($idReferralprogram = ReferralProgramModule::isSponsorised((int) $customer->id, true)) { $referralprogram = new ReferralProgramModule((int) $idReferralprogram); $sponsor = new Customer((int) $referralprogram->id_sponsor); } Link to comment Share on other sites More sharing options...
0 Traumflug Posted November 9, 2017 Share Posted November 9, 2017 I don't have this module, but this code looks suspicious: ...`.`id_sponsor` - 361)' I'd bet this should read ...`.`id_sponsor` = 361)' Note the =. Link to comment Share on other sites More sharing options...
0 Traumflug Posted November 9, 2017 Share Posted November 9, 2017 I've opened a bug report for this issue to not forget it: https://github.com/thirtybees/referralprogram/issues/1 Link to comment Share on other sites More sharing options...
0 lesley Posted November 11, 2018 Share Posted November 11, 2018 Is this still causing an issue for you? I cannot reproduce it, I have tried in both the front and back office. Link to comment Share on other sites More sharing options...
Question
Chandra
Hi, Just migrated to TB and am getting this error when a new user account is created. Kindly give me a hand.
``` [ThirtyBeesDatabaseException]
BIGINT UNSIGNED value is out of range in '(
xxc_tdb
.s
.id_sponsor
- 361)'SELECT s.* FROM
ps_referralprogram
s WHERE (s.id_sponsor
- 361)at line 808 in file classes/db/Db.php 803. if ($webserviceCall && $errno) { 804. $dbg = debugbacktrace(); 805. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97); 806. } elseif (PSDEBUGSQL_ && $errno && !defined('TBINSTALLATIONIN_PROGRESS')) { 807. if ($sql) { 808. throw new PrestaShopDatabaseException($this->getMsgError().'
'); 809. } 810. 811. throw new PrestaShopDatabaseException($this->getMsgError()); 812. } 813. } DbCore->displayError - [line 460 - classes/db/Db.php] - [1 Arguments] DbCore->query - [line 673 - classes/db/Db.php] - [1 Arguments] DbCore->executeS - [line 91 - modules/referralprogram/ReferralProgramModule.php] - [1 Arguments] ReferralProgramModule::getSponsorFriend - [line 725 - modules/referralprogram/referralprogram.php] - [1 Arguments] ReferralProgram->hookAdminCustomers - [line 771 - classes/Hook.php] - [1 Arguments] HookCore::coreCallHook - [line 489 - classes/Hook.php] - [3 Arguments] HookCore::execWithoutCache - [line 280 - classes/Hook.php] - [7 Arguments] HookCore::exec - [line 211 - config/smarty.config.inc.php] - [3 Arguments] smartyHook - [line 274 - config/smarty.config.inc.php] - [2 Arguments] SmartyLazyRegister->__call - [line 856 - vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code] - [2 Arguments] content_5a033ff55220a7_84235799 - [line 188 - vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php] - [1 Arguments] Smarty_Internal_TemplateBase->fetch - [line 424 - classes/SmartyCustom.php] - [7 Arguments] Smarty_Custom_Template->fetch - [line 378 - classes/helper/Helper.php] HelperCore->generate - [line 83 - classes/helper/HelperView.php] HelperViewCore->generateView - [line 3054 - classes/controller/AdminController.php] AdminControllerCore->renderView - [line 997 - controllers/admin/AdminCustomersController.php] AdminCustomersControllerCore->renderView - [line 2420 - classes/controller/AdminController.php] AdminControllerCore->initContent - [line 244 - controllers/admin/AdminCustomersController.php] AdminCustomersControllerCore->initContent - [line 366 - classes/controller/Controller.php] ControllerCore->run - [line 743 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 58 - admin/index.php] ```Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now