View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016028 | mantisbt | api soap | public | 2013-06-07 08:26 | 2014-02-07 18:24 |
Reporter | kaese | Assigned To | rombert | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.15 | ||||
Target Version | 1.2.16 | Fixed in Version | 1.2.16 | ||
Summary | 0016028: Adding note via webservice generates wrong email content for assigned user | ||||
Description | We are seeing a strange behaviour when updating an existing ticket via webservice. Lets asume the following: userX is a MANAGER in ProjectY and userX has an issue assigned to him. add a note via webinterface: An email is generated for userX, telling him that a new note has been added. The email is send from "My name <from@domain.com>" (as configured). The history is missing from the ticket (as configured) add a note via webservice: An email is generated for userX, telling him that a new note has been added. The email is send from "Bugtracker <noreplay@domain.com>". The email has a full history of the ticket attached. it seems like the environment for this email is not correctly initialized, as the value for view_history_threshold is 10 (which is the default value in our setup) . | ||||
Steps To Reproduce | see above. Can be reproduced in our environment. | ||||
Additional Information | The project is configured with: <all users> ProjectY view_history_threshold integer 90 (ADMINISTRATOR) I tried adding some debug output to core/email_api.php:1149 1447 # put history data with the following result:
| ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Please fill in the 'version' field with your MantisBT version. |
|
It's already filled (1.2.15), but apart from that I'm not able to modify this issue. |
|
I think I know what happens. Can you try the attached patch ( on top of master-1.2.x ) and see if it fixes your problem? soap-api-set-gprojectoverride-for-the-mcissuenoteadd.patch (1,210 bytes)
From c23f8c37d3c1a1b237b330155808eaf925ea9723 Wed, 26 Jun 2013 23:51:24 +0300 From: Robert Munteanu <robert@lmn.ro> Date: Wed, 26 Jun 2013 23:51:12 +0300 Subject: [PATCH] soap api: set $g_project_override for the mc_issue_note_add function Fixes #16028: Adding note via webservice generates wrong email content for assigned user diff --git a/api/soap/mc_issue_api.php b/api/soap/mc_issue_api.php index 2dee6ce..f4409d3 100644 --- a/api/soap/mc_issue_api.php +++ b/api/soap/mc_issue_api.php @@ -999,6 +999,8 @@ * @return integer The id of the added note. */ function mc_issue_note_add( $p_username, $p_password, $p_issue_id, $p_note ) { + global $g_project_override; + $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); @@ -1022,6 +1024,8 @@ if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } + + $g_project_override = $t_project_id; if( !access_has_bug_level( config_get( 'add_bugnote_threshold' ), $p_issue_id, $t_user_id ) ) { return mci_soap_fault_access_denied( $t_user_id, "You do not have access rights to add notes to this issue" ); |
|
Your patch looks good. After applying we cannot reproduce this issue anymore. Thank you. |
|
Thanks for confirming, I think I've covered all cases were the project needs to be overridden. |
|
MantisBT: master-1.2.x 1d009970 2013-06-26 12:51 Details Diff |
soap api: set $g_project_override for all applicable mc_issue and mc_project methods Fixes 0016028: Adding note via webservice generates wrong email content for assigned user |
Affected Issues 0016028 |
|
mod - api/soap/mc_issue_api.php | Diff File | ||
mod - api/soap/mc_project_api.php | Diff File | ||
MantisBT: master c9c03411 2013-06-30 11:17 Details Diff |
soap api: set $g_project_override for all applicable mc_issue and mc_project methods Fixes 0016028: Adding note via webservice generates wrong email content for assigned user Conflicts: api/soap/mc_issue_api.php |
Affected Issues 0016028 |
|
mod - api/soap/mc_issue_api.php | Diff File | ||
mod - api/soap/mc_project_api.php | Diff File |