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