Skip to content

Commit

Permalink
Fix #21372: Unable to report issues using the SOAP API - Data truncated
Browse files Browse the repository at this point in the history
for column 'last_updated'
  • Loading branch information
rombert committed Jul 18, 2016
1 parent 6e1766b commit 1746e62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/soap/mc_issue_api.php
Expand Up @@ -749,8 +749,8 @@ function mc_issue_add( $p_username, $p_password, stdClass $p_issue ) {
$t_bug_data->resolution = $t_resolution_id;
$t_bug_data->projection = $t_projection_id;
$t_bug_data->category_id = $t_category_id;
$t_bug_data->date_submitted = isset( $p_issue['date_submitted'] ) ? $p_issue['date_submitted'] : '';
$t_bug_data->last_updated = isset( $p_issue['last_updated'] ) ? $p_issue['last_updated'] : '';
$t_bug_data->date_submitted = isset( $p_issue['date_submitted'] ) ? SoapObjectsFactory::parseDateTimeString($p_issue['date_submitted']) : '';
$t_bug_data->last_updated = isset( $p_issue['last_updated'] ) ? SoapObjectsFactory::parseDateTimeString($p_issue['last_updated']) : '';
$t_bug_data->eta = $t_eta_id;
$t_bug_data->profile_id = isset( $p_issue['profile_id'] ) ? $p_issue['profile_id'] : 0;
$t_bug_data->os = isset( $p_issue['os'] ) ? $p_issue['os'] : '';
Expand Down
7 changes: 7 additions & 0 deletions tests/soap/IssueAddTest.php
Expand Up @@ -134,6 +134,9 @@ public function testCreateIssueWithRareFields() {
$t_issue_to_add['fixed_in_version'] = 'fixed version';
$t_issue_to_add['target_version'] = 'target version';
$t_issue_to_add['sticky'] = true;

$t_dt = new DateTime();
$t_issue_to_add['last_updated'] = $t_dt->format( DateTime::ISO8601 );

$t_issue_id = $this->client->mc_issue_add( $this->userName, $this->password, $t_issue_to_add );

Expand All @@ -149,6 +152,10 @@ public function testCreateIssueWithRareFields() {
$this->assertEquals( $t_issue_to_add['fixed_in_version'], $t_issue->fixed_in_version );
$this->assertEquals( $t_issue_to_add['target_version'], $t_issue->target_version );
$this->assertEquals( $t_issue_to_add['sticky'], $t_issue->sticky );

$t_read_dt = DateTime::createFromFormat( DateTime::ISO8601, $t_issue->last_updated );

$this->assertEquals( $t_dt, $t_read_dt );
}

/**
Expand Down

0 comments on commit 1746e62

Please sign in to comment.