View Issue Details

IDProjectCategoryView StatusLast Update
0025470mantisbtapi soappublic2019-08-25 12:36
Reporterchadmiss Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
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 closeddregad 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 15:27

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 00:59

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 01:15

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