Skip to content

Commit 4c4e658

Browse files
committedAug 9, 2012
api soap: correct usage of bugnote_set_view_state
Fixes #14573: Updating an issue's view state always sets it to private Conflicts: tests/soap/IssueNoteTest.php
1 parent 804cd34 commit 4c4e658

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
 

‎api/soap/mc_issue_api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ function mc_issue_note_update( $p_username, $p_password, $p_note ) {
11291129
if ( isset( $p_note['view_state'] ) ) {
11301130
$t_view_state = $p_note['view_state'];
11311131
$t_view_state_id = mci_get_enum_id_from_objectref( 'view_state', $t_view_state );
1132-
bugnote_set_view_state( $t_issue_note_id, $t_view_state_id );
1132+
bugnote_set_view_state( $t_issue_note_id, $t_view_state_id == VS_PRIVATE );
11331133
}
11341134

11351135
bugnote_set_text( $t_issue_note_id, $p_note['text'] );

‎tests/soap/IssueNoteTest.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ public function testAddThenUpdateThenDeleteNote() {
189189

190190
$noteDataNew = array(
191191
'id' => $issueNoteId,
192-
'text' => "some new note"
192+
'text' => "some new note",
193+
'view_state' => array ( 'id' => 10 /* public */)
193194
);
194195

195196
$this->client->mc_issue_note_update(
@@ -202,7 +203,9 @@ public function testAddThenUpdateThenDeleteNote() {
202203
$this->password,
203204
$issueId);
204205

205-
$this->assertEquals( 1, count( $issueWithNote->notes ) );
206+
$this->assertEquals( 1, count( $issueWithNote->notes ) );
207+
$this->assertEquals( $noteDataNew['text'], $issueWithNewNote->notes[0]->text );
208+
$this->assertEquals( 'public', $issueWithNewNote->notes[0]->view_state->name );
206209

207210
$this->client->mc_issue_note_delete(
208211
$this->userName,

0 commit comments

Comments
 (0)
Please sign in to comment.