Skip to content

Commit e7815ec

Browse files
committedSep 23, 2011
SOAP API: Ensure that helper_get_current_project() resolves to the requested project
Fixes #13324: Adding or updating issue with mylyn causes error #13
1 parent cbbe1dd commit e7815ec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎api/soap/mc_issue_api.php

+8
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@ function mc_issue_get_id_from_summary( $p_username, $p_password, $p_summary ) {
507507
* @return integer The id of the created issue.
508508
*/
509509
function mc_issue_add( $p_username, $p_password, $p_issue ) {
510+
511+
global $g_project_override;
512+
510513
$t_user_id = mci_check_login( $p_username, $p_password );
511514
if( $t_user_id === false ) {
512515
return mci_soap_fault_login_failed();
@@ -515,6 +518,7 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
515518
$t_project = $p_issue['project'];
516519

517520
$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
518522

519523
if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
520524
return mci_soap_fault_access_denied( $t_user_id );
@@ -681,6 +685,8 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
681685
* @return integer The id of the created issue.
682686
*/
683687
function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
688+
global $g_project_override;
689+
684690
$t_user_id = mci_check_login( $p_username, $p_password );
685691
if( $t_user_id === false ) {
686692
return mci_soap_fault_login_failed();
@@ -695,6 +701,8 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
695701
if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
696702
return mci_soap_fault_access_denied( $t_user_id );
697703
}
704+
705+
$g_project_override = $t_project_id; // ensure that helper_get_current_project() calls resolve to this project id
698706

699707
$t_project_id = mci_get_project_id( $p_issue['project'] );
700708
$t_reporter_id = isset( $p_issue['reporter'] ) ? mci_get_user_id( $p_issue['reporter'] ) : $t_user_id ;

0 commit comments

Comments
 (0)
Please sign in to comment.