Skip to content

Commit

Permalink
api soap: correct usage of bugnote_set_view_state
Browse files Browse the repository at this point in the history
Fixes #14573: Updating an issue's view state always sets it to private
  • Loading branch information
rombert committed Aug 9, 2012
1 parent e400ed4 commit 938ce31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/soap/mc_issue_api.php
Expand Up @@ -1125,7 +1125,7 @@ function mc_issue_note_update( $p_username, $p_password, $p_note ) {
if ( isset( $p_note['view_state'] ) ) {
$t_view_state = $p_note['view_state'];
$t_view_state_id = mci_get_enum_id_from_objectref( 'view_state', $t_view_state );
bugnote_set_view_state( $t_issue_note_id, $t_view_state_id );
bugnote_set_view_state( $t_issue_note_id, $t_view_state_id == VS_PRIVATE );
}

bugnote_set_text( $t_issue_note_id, $p_note['text'] );
Expand Down
5 changes: 3 additions & 2 deletions tests/soap/IssueNoteTest.php
Expand Up @@ -189,7 +189,8 @@ public function testAddThenUpdateThenDeleteNote() {

$noteDataNew = array(
'id' => $issueNoteId,
'text' => "some new note"
'text' => "some new note",
'view_state' => array ( 'id' => 10 /* public */)
);

$this->client->mc_issue_note_update(
Expand All @@ -203,8 +204,8 @@ public function testAddThenUpdateThenDeleteNote() {
$issueId);

$this->assertEquals( 1, count( $issueWithNote->notes ) );

$this->assertEquals( $noteDataNew['text'], $issueWithNewNote->notes[0]->text );
$this->assertEquals( 'public', $issueWithNewNote->notes[0]->view_state->name );

$this->client->mc_issue_note_delete(
$this->userName,
Expand Down

0 comments on commit 938ce31

Please sign in to comment.