View Issue Details

IDProjectCategoryView StatusLast Update
0025470mantisbtapi soappublic2019-06-11 06:37
Reporterchadmiss Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.3.8 
Target Version2.22.0Fixed in Version2.22.0 
Summary0025470: SOAP API return value does not match definition in WSDL
Description

on success the function mc_project_version_update() returns FALSE, i.e. the nonexistent return value of version_update() which is casted to NULL on several implementations.

on an older version (1.2.19) version_update() returned true on success

TagsNo tags attached.

Relationships

has duplicate 0025838 closeddregad wsdl mc_project_version_updateResponse not correct (boolean) 
has duplicate 0025856 resolveddregad SOAP API return value does not match definition in WSDL 

Activities

dregad

dregad

2019-02-13 10:33

developer   ~0061483

version_update() does not actually return anything (ie. @return void). This was indeed changed in MantisBT master a80f4476 (1.3.0-beta.1) prior to which it would indeed return true (and only true) in case of success - an error would be triggered otherwise, so no return value in this case.

Using the return value in this case is incorrect, so mc_project_version_update() as well as any other function using version_update's return value should have been updated following the above-mentioned change.

stefan.cordes

stefan.cordes

2019-06-04 08:38

reporter   ~0062188

As mantis-axis-soap-client is just generating from the official wsdl you need to change the wsdl first: 0025838

dregad

dregad

2019-06-05 04:35

developer   ~0062196

IMO, instead of changing the WSDL, we should make sure that the API mc_project_version_update() returns the expected boolean type.

Could you kindly confirm that the patch below fixes the problem

diff --git a/api/soap/mc_project_api.php b/api/soap/mc_project_api.php
index 17f87582c..73764fa92 100644
--- a/api/soap/mc_project_api.php
+++ b/api/soap/mc_project_api.php
@@ -553,7 +553,8 @@ function mc_project_version_update( $p_username, $p_password, $p_version_id, std
    $t_version_data->date_order = $t_date_order;
    $t_version_data->obsolete = $t_obsolete;

-   return version_update( $t_version_data );
+   version_update( $t_version_data );
+   return true;
 }

 /**
stefan.cordes

stefan.cordes

2019-06-05 04:54

reporter   ~0062198

+1

(maybe not only version_update but some other "return"s needs to be re-added to be wsdl conform again
[ from https://github.com/mantisbt/mantisbt/commit/a80f447687722b52160d00c96c21a5be5f4329e1 ]
e.g. token_delete_by_owner , user_pref_update , version_remove )

dregad

dregad

2019-06-05 05:28

developer   ~0062203

maybe not only version_update but some other "return"s needs to be re-added to be wsdl conform again
e.g. token_delete_by_owner , user_pref_update , version_remove

OK for version_remove(), I'll include the fix. The return values of the other 2 functions you mention are not used in SOAP API, AFAICT.

If you notice any additional errors / discrepancies between code and WSDL, please open additional issues with relevant details.

dregad

dregad

2019-06-05 05:32

developer   ~0062204

PR https://github.com/mantisbt/mantisbt/pull/1517

Related Changesets

MantisBT: master a80f4476

2013-10-14 19:27:18

Paul Richards

Details Diff
Further backports of db_int*/phpdoc* Affected Issues
0017333, 0025470
mod - admin/install.php Diff File
mod - core/print_api.php Diff File
mod - core/profile_api.php Diff File
mod - core/project_hierarchy_api.php Diff File
mod - core/relationship_api.php Diff File
mod - core/string_api.php Diff File
mod - core/summary_api.php Diff File
mod - core/tag_api.php Diff File
mod - core/tokens_api.php Diff File
mod - core/user_api.php Diff File
mod - core/user_pref_api.php Diff File
mod - core/utility_api.php Diff File
mod - core/version_api.php Diff File
mod - core/wiki_api.php Diff File

MantisBT: master a309d0ab

2019-06-05 04:59:47

dregad

Details Diff
Fix mc_project_version_update() return value

The function's return type does not match the WSDL definition.

This is a regression introduced by a80f447687722b52160d00c96c21a5be5f4329e1
which changed version_update()'s return type from true (bool) to void
Since mc_project_version_update() actually returned that, it causes a
side effect because void == NULL == false.

To avoid an unnecessary and potentially breaking change in the WSDL, the
function now returns true.

Fixes 0025470
Affected Issues
0025470
mod - api/soap/mc_project_api.php Diff File

MantisBT: master 5039c7b8

2019-06-05 05:15:19

dregad

Details Diff
Fix mc_project_version_delete() return value

The function's return type does not match the WSDL definition.

This is a regression introduced by a80f447687722b52160d00c96c21a5be5f4329e1
which changed version_delete()'s return type from true (bool) to void
Since mc_project_version_delete() actually returned that, it causes a
side effect because void == NULL == false.

To avoid an unnecessary and potentially breaking change in the WSDL, the
function now returns true.

Fixes 0025470
Affected Issues
0025470
mod - api/soap/mc_project_api.php Diff File

Issue History

Date Modified Username Field Change
2019-02-13 04:54 chadmiss New Issue
2019-02-13 10:33 dregad Note Added: 0061483
2019-02-13 10:34 dregad Status new => acknowledged
2019-02-13 10:34 dregad Product Version 2.11.1 => 1.3.8
2019-06-04 08:38 stefan.cordes Note Added: 0062188
2019-06-05 04:19 dregad Relationship added related to 0025838
2019-06-05 04:35 dregad Note Added: 0062196
2019-06-05 04:54 stefan.cordes Note Added: 0062198
2019-06-05 04:55 dregad Changeset attached => MantisBT master a80f4476
2019-06-05 05:06 dregad Relationship replaced has duplicate 0025838
2019-06-05 05:28 dregad Note Added: 0062203
2019-06-05 05:32 dregad Note Added: 0062204
2019-06-05 05:33 dregad Assigned To => dregad
2019-06-05 05:33 dregad Status acknowledged => assigned
2019-06-05 05:33 dregad Target Version => 2.22.0
2019-06-11 06:27 dregad Changeset attached => MantisBT master a309d0ab
2019-06-11 06:27 dregad Changeset attached => MantisBT master 5039c7b8
2019-06-11 06:27 dregad Status assigned => resolved
2019-06-11 06:27 dregad Resolution open => fixed
2019-06-11 06:27 dregad Fixed in Version => 2.22.0
2019-06-11 06:29 dregad Summary function mc_project_version_update returns FALSE on success => SOAP API return does not match definition in WSDL
2019-06-11 06:29 dregad Description Updated View Revisions
2019-06-11 06:32 dregad Issue cloned: 0025856
2019-06-11 06:32 dregad Relationship added has duplicate 0025856
2019-06-11 06:37 dregad Summary SOAP API return does not match definition in WSDL => SOAP API return value does not match definition in WSDL