@@ -508,6 +508,9 @@ function mc_issue_get_id_from_summary( $p_username, $p_password, $p_summary ) {
508
508
* @return integer The id of the created issue.
509
509
*/
510
510
function mc_issue_add ( $ p_username , $ p_password , $ p_issue ) {
511
+
512
+ global $ g_project_override ;
513
+
511
514
$ t_user_id = mci_check_login ( $ p_username , $ p_password );
512
515
if ( $ t_user_id === false ) {
513
516
return mci_soap_fault_login_failed ();
@@ -516,6 +519,7 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
516
519
$ t_project = $ p_issue ['project ' ];
517
520
518
521
$ t_project_id = mci_get_project_id ( $ t_project );
522
+ $ g_project_override = $ t_project_id ; // ensure that helper_get_current_project() calls resolve to this project id
519
523
520
524
if ( !mci_has_readwrite_access ( $ t_user_id , $ t_project_id ) ) {
521
525
return mci_soap_fault_access_denied ( $ t_user_id );
@@ -682,6 +686,8 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
682
686
* @return integer The id of the created issue.
683
687
*/
684
688
function mc_issue_update ( $ p_username , $ p_password , $ p_issue_id , $ p_issue ) {
689
+ global $ g_project_override ;
690
+
685
691
$ t_user_id = mci_check_login ( $ p_username , $ p_password );
686
692
if ( $ t_user_id === false ) {
687
693
return mci_soap_fault_login_failed ();
@@ -696,6 +702,8 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
696
702
if ( !mci_has_readwrite_access ( $ t_user_id , $ t_project_id ) ) {
697
703
return mci_soap_fault_access_denied ( $ t_user_id );
698
704
}
705
+
706
+ $ g_project_override = $ t_project_id ; // ensure that helper_get_current_project() calls resolve to this project id
699
707
700
708
$ t_project_id = mci_get_project_id ( $ p_issue ['project ' ] );
701
709
$ t_reporter_id = isset ( $ p_issue ['reporter ' ] ) ? mci_get_user_id ( $ p_issue ['reporter ' ] ) : $ t_user_id ;
0 commit comments