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 f8a11be

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 268f72a commit f8a11be

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
@@ -508,6 +508,9 @@ function mc_issue_get_id_from_summary( $p_username, $p_password, $p_summary ) {
508508
* @return integer The id of the created issue.
509509
*/
510510
function mc_issue_add( $p_username, $p_password, $p_issue ) {
511+
512+
global $g_project_override;
513+
511514
$t_user_id = mci_check_login( $p_username, $p_password );
512515
if( $t_user_id === false ) {
513516
return mci_soap_fault_login_failed();
@@ -516,6 +519,7 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
516519
$t_project = $p_issue['project'];
517520

518521
$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
519523

520524
if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
521525
return mci_soap_fault_access_denied( $t_user_id );
@@ -682,6 +686,8 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
682686
* @return integer The id of the created issue.
683687
*/
684688
function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
689+
global $g_project_override;
690+
685691
$t_user_id = mci_check_login( $p_username, $p_password );
686692
if( $t_user_id === false ) {
687693
return mci_soap_fault_login_failed();
@@ -696,6 +702,8 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
696702
if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
697703
return mci_soap_fault_access_denied( $t_user_id );
698704
}
705+
706+
$g_project_override = $t_project_id; // ensure that helper_get_current_project() calls resolve to this project id
699707

700708
$t_project_id = mci_get_project_id( $p_issue['project'] );
701709
$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.