View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0009337 | mantisbt | api soap | public | 2008-07-03 17:36 | 2009-06-26 12:03 |
Reporter | rombert | Assigned To | vboctor | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.1.2 | ||||
Fixed in Version | 1.2.0a3 | ||||
Summary | 0009337: [patch] Target version is not erased anymore when using the SOAP API | ||||
Description | I have created a simple patch which allows issues to be updated using the SOAP API without erasing the target version. This also allows the web interface to function properly, so it's a pure bugfix. Patch created against 5338 (1.1.2) | ||||
Tags | patch | ||||
Attached Files | preserve-target-version-soap.patch (1,654 bytes)
Index: api/soap/mc_issue_api.php =================================================================== --- api/soap/mc_issue_api.php (revision 5388) +++ api/soap/mc_issue_api.php (working copy) @@ -685,7 +685,7 @@ $t_bug_data->additional_information = isset( $v_additional_information ) ? $v_additional_information : ''; # submit the issue - $t_is_success = bug_update($p_issue_id,$t_bug_data,true,false ); + $t_is_success = bug_update($p_issue_id,$t_bug_data,true,false, false ); mci_issue_set_custom_fields( $p_issue_id, $v_custom_fields ); Index: core/bug_api.php =================================================================== --- core/bug_api.php (revision 5388) +++ core/bug_api.php (working copy) @@ -777,7 +777,7 @@ # -------------------- # Update a bug from the given data structure # If the third parameter is true, also update the longer strings table - function bug_update( $p_bug_id, $p_bug_data, $p_update_extended = false, $p_bypass_mail = false ) { + function bug_update( $p_bug_id, $p_bug_data, $p_update_extended = false, $p_bypass_mail = false, $p_update_target_version = true ) { $c_bug_id = db_prepare_int( $p_bug_id ); $c_bug_data = bug_prepare_db( $p_bug_data ); @@ -829,7 +829,7 @@ fixed_in_version='$c_bug_data->fixed_in_version',"; $t_roadmap_updated = false; - if ( access_has_project_level( config_get( 'roadmap_update_threshold' ) ) ) { + if ( $p_update_target_version && access_has_project_level( config_get( 'roadmap_update_threshold' ) ) ) { $query .= " target_version='$c_bug_data->target_version',"; $t_roadmap_updated = true; | ||||
I surely agree that's an ugly bug we should get rid of. Then, if the target version is lost is because the bug_update function is receiving an empty field from the soap api. It seems to me that a better fix should be this one:
|
|
I completely agree with your assessment of the patch. It's just a hack. On the other hand, with your patch the target_version field is still blanked out. As far as I know, the target_version is not yet added to the SOAP api ( see 0009245 for a bug report + patch which tries to add it to the SOAP api ) and this is why I have resorted to the hackish solution, since I'm not up to adding the field to the SOAP api ( but perhaps jeremib is ) |
|
Thanks for testing my patch. It seems the problem is much more involved than I expected as the SOAP api does not seem to be robust enough to cope with the missing parameter, or maybe it's just me not understanding it properly... |
|
I would really like to get the target_version sorted out, but I'm more or less at a loss when it comes to how to do do it. Is there anyone that I could ping about how to add a field to the SOAP API ( a very bird's eye view of the process, I did my part of PHP programming until about 3 years ago )? |
|
@rombert, can you please test the fix for 0009245 and see if it fixes the problem you are having. |
|
@vboctor: I've checked out mantisbt up to commit d7f2a839e0945fd34f8353423c6889287ffe46dc
But I can't retrieve any issue headers using a filter ( which is the workflow I'm using ) When requesting: <pre> I get back <pre> So I really can't test this ATM. |
|
Same steps work fine with 1.1.x . Should I file a separate bug report for this? |
|
Yes, please file a separate bug for it. |
|
And thus issue 0009805 is born. |
|