Bug #30211 DB Error: unknown error [class.issue.php line 1463]
Submitted: 2 Aug 2007 20:31 Modified: 2 Sep 2007 21:23
Reporter: Jeremy Rumpf Email Updates:
Status: No Feedback Impact on me:
None 
Category:Eventum Severity:S3 (Non-critical)
Version:2.0.1 OS:Linux (Apache 2.0.59 PHP 5.2.3)
Assigned to: Assigned Account CPU Architecture:Any

[2 Aug 2007 20:31] Jeremy Rumpf
Description:
A more detailed error message follows:

'UPDATE
                    eventum.eventum_issue
                 SET
                    iss_updated_date='2007-08-02 20:08:54',
                    iss_last_public_action_date='2007-08-02 20:08:54',
                    iss_last_public_action_type='updated',iss_prc_id=9,iss_expected_resolution_date=null,
                    iss_pre_id=0,
                    iss_pri_id=11,
                    iss_sta_id=1,
                    iss_res_id=0,
                    iss_summary='test summary',
                    iss_description=' test description'
                   iss_dev_time='0',
                    iss_percent_complete= '',
                    iss_trigger_reminders=1,
                    iss_grp_id ='0'
                 WHERE
                    iss_id=16 [nativecode=1366 ** Incorrect integer value: '' for column 'iss_percent_complete' at row 1]'

This is in eventum setup using the Customer API. The Column "Percent Complete" is not viewable to the customer. I have it set to "Developer" in the Project->Manage Columns To Display. The issue occurs when a customer edits a ticket, clicks "update issue", and subsequently clicks "update" on the update issue overview. Since the "Percent Complete" columns is not being displayed, it is not being passed via POST vars. This causes mysql to barf when updating iss_percent_complete = ''. 

Not sure if this is the proper fix, but works for me.

How to repeat:
Setup eventum, setup a project, set % Complete in Manage Columns To Display for said project to never display, create a ticket, attempt to update issue overview on ticket.

Suggested fix:
To quickly fix the issue for me I simply moved the column to have an !empty() check:

if (!empty($_POST['percent_complete'])) {
   $stmt .= "iss_percent_complete= '" . Misc::escapeString($_POST["percent_complete"]) . "',";
}
[2 Aug 2007 20:43] Jeremy Rumpf
Updated version tag to 2.0.1
[2 Aug 2007 21:23] Bryan Alsdorf
This is most likely caused by having SQL_MODE set to strict. Eventum currently doesn't support strict SQL_MODE.

You can fix this problem my changing SQL_MODE to '' for the DB connection Eventum uses. The easiest way is to edit include/class.db_api.php and add the following like at the end of the constructor.

$this->dbh->query("SET SQL_MODE = ''");

Please let me know if this solves your problem.
[2 Sep 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".