View Issue Details

IDProjectCategoryView StatusLast Update
0019345mantisbtapi soappublic2016-08-15 09:02
Reporterlukas.hubnerAssigned Todregad 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.19 
Target Version1.2.20Fixed in Version1.2.20 
Summary0019345: Error when custom field is specified only by its name (no id provided)
Description

Using SOAP api from C# (win64, .net 4.5).
When you specify custom field by ObjectRef with only name filled, then you get an error - index 'id' not found.

I thing that /api/soap/mc_custom_field_api.php line 21 should be modified to:

if(isset($p_object_ref['id']) && (int) $p_object_ref['id'] != 0 ) {

TagsNo tags attached.

Activities

lukas.hubner

lukas.hubner

2015-02-04 06:30

reporter   ~0048785

Maybe also the "!= 0" in this line should be changed to "> 0"

dregad

dregad

2015-02-04 13:08

developer   ~0048788

I confirm the error you reported.

While testing, I noted several other occurences of errors/warnings, depending on how the custom field is specified (e.g. id == 0, neither id nor name specified, etc.

I don't think it's necessary to change from != to >, if you give it a negative custom field id, the API will simply return APPLICATION ERROR 1300 (custom field not found).

Related Changesets

MantisBT: master-1.2.x 663ea17b

2015-02-04 12:29:27

dregad

Details Diff
SOAP: fix various errors with custom fields

This commit fixes several occurences of errors, warnings and PHP notices
when updating custom fields via SOAP API.

Adding a check to ensure the CF specification includes 'field', either
'name' or 'id' (which must be != 0), and 'value'. If invalid, a specific
SOAP fault is returned.

Fixes 0019345
mod - api/soap/mc_custom_field_api.php Diff File
mod - api/soap/mc_issue_api.php Diff File

MantisBT: master a97334ab

2015-02-04 12:29:27

dregad

Details Diff
SOAP: fix various errors with custom fields

This commit fixes several occurences of errors, warnings and PHP notices
when updating custom fields via SOAP API.

Adding a check to ensure the CF specification includes 'field', either
'name' or 'id' (which must be != 0), and 'value'. If invalid, a specific
SOAP fault is returned.

Fixes 0019345
mod - api/soap/mc_custom_field_api.php Diff File
mod - api/soap/mc_issue_api.php Diff File

Issue History

Date Modified Username Field Change
2015-02-04 06:16 lukas.hubner New Issue
2015-02-04 06:30 lukas.hubner Note Added: 0048785
2015-02-04 13:08 dregad Assigned To => dregad
2015-02-04 13:08 dregad Status new => assigned
2015-02-04 13:08 dregad Note Added: 0048788
2015-02-04 13:11 dregad Changeset attached => MantisBT master-1.2.x 663ea17b
2015-02-04 13:11 dregad Status assigned => resolved
2015-02-04 13:11 dregad Resolution open => fixed
2015-02-04 13:11 dregad Fixed in Version => 1.2.20
2015-02-04 13:11 dregad Changeset attached => MantisBT master a97334ab
2015-02-04 13:11 dregad Target Version => 1.2.20
2016-08-15 09:02 dregad Status resolved => closed