View Issue Details

IDProjectCategoryView StatusLast Update
0009121mantisbtapi soappublic2009-01-15 11:27
Reporterurkle Assigned Tograngeway  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1.1 
Fixed in Version1.2.0a3 
Summary0009121: SOAP API incorrectly exports Relationship types
Description

the SOAP api exports the relationships in two passes, source, and destination. But only exposes them to the client as "source", so the client gets incorrect information on all destination bugs if it looks at the "type ID". And since the mantis installation can have custom strings, cannot use the "text" to perform any functionality in a client reliably. (see https://sourceforge.net/tracker/index.php?func=detail&aid=1956462&group_id=189858&atid=931013 )

the fix. add a relationship_get_complementary_type call to mci_issue_get_relationships for the "dest" pass.

Tagspatch
Attached Files
mc_soap_patch.diff (838 bytes)   
Index: mc_issue_api.php
===================================================================
--- mc_issue_api.php    (revision 5225)
+++ mc_issue_api.php    (working copy)
@@ -234,7 +234,7 @@
                                $t_relationship = array();
                                $t_relationship['id'] = $t_relship_row->id;
                                $t_reltype = array();
-                               $t_reltype['id'] = $t_relship_row->type;
+                               $t_reltype['id'] = relationship_get_complementary_type($t_relship_row->type);
                                $t_reltype['name'] = relationship_get_description_dest_side($t_relship_row->type);
                                $t_relationship['type'] = $t_reltype;
                                $t_relationship['target_id'] = $t_relship_row->src_bug_id;
mc_soap_patch.diff (838 bytes)   

Activities

grangeway

grangeway

2008-05-04 06:05

reporter   ~0017760

Hello,

I'm not really that familiar with the SOAP API myself, but would I be correct in thinking we should expose
a) the type name (localised)
b) the type id (for reasons in bug report)
then also:
c) the complementary type name
d) the complementary id

Paul

urkle

urkle

2008-05-14 22:50

reporter   ~0017836

probably the complementary information should be given in a separate "bug relationship" enum fetch instead of with each issue.

rombert

rombert

2008-08-01 10:54

reporter   ~0018983

As far as I can see this is quite a small change and renders task relations unusable with the SOAP api and has a patch attached.

Any chance of considering this for inclusion in the next stable version?

I would hope that it would be included in the 1.2 stream anyway.

grangeway

grangeway

2008-11-29 19:00

reporter   ~0020133

Hello,

I've fixed this issue in my local git checkout - this will be pushed to the central git.mantisbt.org server shortly.

THanks
Paul

rombert

rombert

2008-12-03 09:58

reporter   ~0020214

@grangeway: Has the changeset been pushed yet to the git.mantisbt.org ? If so , which one is it?

Thanks,

Robert

Related Changesets

MantisBT: master f6174143

2008-11-29 19:00

Paul Richards


Details Diff
return null if no files/notes are found (instead of empty array)

also fix 0009121: SOAP API incorrectly exports Relationship types
Affected Issues
0009121
mod - api/soap/mc_issue_api.php Diff File
mod - core/bug_api.php Diff File