View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0010775 | mantisbt | api soap | public | 2009-07-29 03:16 | 2009-10-07 14:19 |
Reporter | rombert | Assigned To | jreese | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.0rc1 | ||||
Target Version | 1.2.0rc2 | Fixed in Version | 1.2.0rc2 | ||
Summary | 0010775: [regression] Unable to update issue using SOAP API | ||||
Description | I'm getting a server error when updating an issue using the SOAP API. The error log shows: <pre>[Wed Jul 29 10:05:44 2009] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function bug_update() in /home/robert/public_html/mantis/mantisbt-1.2.0rc1/api/soap/mc_issue_api.php on line 691</pre> and a git bisect between 1.2.0a3 and 1.2.0rc1 has brought up <pre>commit 97b67e4bbb2f2df5f6fb24eea5b4bb37e1c28acd
:040000 040000 afa657d05e97d7325b7007a33df7338830d547d3 9aab46648148fde920b648dac694992765a85f59 M api I have confirmed the badness of the commit by reverting and testing. Please consider fixing this for the next 1.2 RC or release, as it's a showstopper for most consumers of the SOAP API. | ||||
Tags | patch | ||||
Attached Files | 0001-Update-BugData-to-allow-creation-of-issue-from-the-S.patch (1,346 bytes)
From b991a765c78d5e6c9ecbd23c2ff5e4cd726a8921 Mon Sep 17 00:00:00 2001 From: Robert Munteanu <robert.munteanu@gmail.com> Date: Fri, 21 Aug 2009 14:03:21 +0300 Subject: [PATCH] Update BugData to allow creation of issue from the SOAP API The profile_id is now initially set to 0, as indicated by giallu, and the history_log_event_direct calls are invoked using the object's fields, rather than parameters. --- core/bug_api.php | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/bug_api.php b/core/bug_api.php index 58b3f22..a055510 100644 --- a/core/bug_api.php +++ b/core/bug_api.php @@ -99,7 +99,7 @@ class BugData { # omitted: # var $bug_text_id - protected $profile_id; + protected $profile_id = 0; # extended info protected $description = ''; @@ -360,8 +360,9 @@ class BugData { history_log_event_special( $this->id, NEW_BUG ); # log changes, if any (compare happens in history_log_event_direct) - history_log_event_direct( $t_bug_id, 'status', $t_original_status, $t_status ); - history_log_event_direct( $t_bug_id, 'handler_id', 0, $c_handler_id ); + history_log_event_direct( $this->id, 'status', $t_original_status, $t_status ); + if ( 0 != $this->handler_id ) + history_log_event_direct( $this->id, 'handler_id', 0, $this->handler_id ); return $this->id; } -- 1.6.3.3 | ||||
kudos to git, shame on paulr... |
|
It's worth mentioning that mc_issue_add does not work either. I didn't have the time to bisect it - too many other failures to skip, but the error is <pre>com.itsolut.mantis.core.exception.MantisRemoteException: Error Type: APPLICATION ERROR 0000401, |
|
Robert, for the issue_add problem can you check if the following fixes the problem? diff --git a/core/bug_api.php b/core/bug_api.php
|
|
@giallu: thanks, that does move me forward a bit. I now get (sorry, can't beautify it): Error Description: My guess is that it's BugData::create(), lines 362:364, where I see $t_bug_id referenced, but I don't see it being assigned or declared anywhere: <pre> # log changes, if any (compare happens in history_log_event_direct) |
|
Confirmed! Commenting out those lines makes the create call succesful. Changing from $t_bug_id to $this->id makes the create call halt due to: <pre>Undefined variable: c_handler_id</pre> I'm prepping a patch which works for me. |
|
Please see the attached patch. I've verified it both using the SOAP API and the HTML interface, with both simple and advanced report pages, to check that status and handler changes are properly recorded in the history. |
|
I tried the patch. |
|
@ericq: the patch is only for mc_issue_add . I have not had time to look into mc_issue_update ( and probably can't since I don't know the codebase well enough ). Does creating new issues work for you with the patch applied? |
|
I have already moved to 1.2.0rc1 for other reasons and am now screwed as I cannot use Mylyn-Mantis connector. This has adversely affected my day-to-day workflow. This is a high-priority bug for me. |
|
This works for me now, probably fixed by 03130d37b131d4223e5049b531491955dbbd2431 . |
|
This should be fixed by Victor's commits to 1.2 and master branches. |
|
I just grabbed the 1.2 from version control and it appears to be working for me as well. |
|
MantisBT: master-1.2.x 03130d37 2009-10-05 02:20 Details Diff |
Fixes for SOAP API 1. mc_issue_add was broken since profile id wasn't set. 2. mc_issue_update was broken since it was still using bug_update() which doesn't exist anymore. 3. mc_issue_add was not adding the notes since it was used $v_notes which is undefined. |
Affected Issues 0010775, 0010955 |
|
mod - api/soap/mc_issue_api.php | Diff File |