Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 938ce31

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
1 parent e400ed4 commit 938ce31

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
 

‎api/soap/mc_issue_api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ function mc_issue_note_update( $p_username, $p_password, $p_note ) {
11251125
if ( isset( $p_note['view_state'] ) ) {
11261126
$t_view_state = $p_note['view_state'];
11271127
$t_view_state_id = mci_get_enum_id_from_objectref( 'view_state', $t_view_state );
1128-
bugnote_set_view_state( $t_issue_note_id, $t_view_state_id );
1128+
bugnote_set_view_state( $t_issue_note_id, $t_view_state_id == VS_PRIVATE );
11291129
}
11301130

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

‎tests/soap/IssueNoteTest.php

+3-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(
@@ -203,8 +204,8 @@ public function testAddThenUpdateThenDeleteNote() {
203204
$issueId);
204205

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

209210
$this->client->mc_issue_note_delete(
210211
$this->userName,

0 commit comments

Comments
 (0)
Please sign in to comment.