Anton Qcl Posted October 3, 2013 Report Posted October 3, 2013 Version: 3.0.3URL: /admin/clients/addservice/40/2/6/?parent_service_id=59Action: Press button "Add Service"Problem: When I trying to apply coupon to addon-package based on service with my custom module I'm getting next error. Error: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '=' for column 'used_qty' at row 1 on line 124 in /var/www/my.blesta.site/public_html/lib/model.php Printing Stack Trace: #0 /var/www/my.blesta.site/lib/model.php(124): PDOStatement->execute(Array) #1 /var/www/my.blesta.site/public_html/components/record/record.php(232): Model->query('UPDATE `coupons...', Array) #2 /var/www/my.blesta.site/public_html/app/models/services.php(810): Record->update('coupons') #3 /var/www/my.blesta.site/public_html/app/controllers/admin_clients.php(3930): Services->add(Array, Array, true) #4 /var/www/my.blesta.site/public_html/app/controllers/admin_clients.php(3843): AdminClients->createService(Array, Array) #5 /var/www/my.blesta.site/public_html/app/controllers/admin_clients.php(3407): AdminClients->processServiceStep('confirm', Object(stdClass), Object(stdClass), Object(stdClass)) #6 /var/www/portal.myglt.net/public_html/lib/dispatcher.php(111): AdminClients->addService() #7 /var/www/portal.myglt.net/public_html/index.php(21): Dispatcher::dispatch('/admin/clients/...') #8 {main} Code of my function "getAdminAddFields": public function getAdminAddFields($package, $vars=null) { Loader::loadHelpers($this, array("Html")); $row = $this->getModuleRow($package->module_row); $fields = new ModuleFields(); /* Logic to getting array $numbers */ $number = $fields->label("Number", "number"); $number->attach( $fields->fieldSelect( 'number', $numbers, $this->Html->ifSet($vars->did_id), array( 'id' => "number" ) ) ); $fields->setField($number); //Trying to force set qty /*$qty = $fields->fieldHidden( "qty", 1, array( 'id' => "did_qty", ) ); $fields->setField($qty);*/ return $fields; } PS Service is added despite on error.
Anton Qcl Posted October 8, 2013 Author Report Posted October 8, 2013 Does anyone have any ideas?Maybe I have to show other functions from my code?
Tyson Posted October 8, 2013 Report Posted October 8, 2013 Yeah, I think we'll need more information to help you debug. The used_qty is set to coupons.used_qty+1 when the service is added, so I'm not sure how it could have the value "=". You can try to dump the $vars data before the service is created to see if something is amiss.
Anton Qcl Posted October 22, 2013 Author Report Posted October 22, 2013 Hm, the problem has gone on version 3.0.4.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now