View Issue Details

IDProjectCategoryView StatusLast Update
0014094mantisbtapi soappublic2013-04-06 08:18
Reportertino Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformMSI Wind - Intel Atom 1.60 GHzOSUbuntuOS Version10.4
Product Version1.2.9 
Target Version1.2.11Fixed in Version1.2.11 
Summary0014094: mc_issue_add project['name'] is not used
Description

If I want to add a new issue by using the project name. Ive get following Response:
Array
(
[faultcode] => Server
[faultactor] =>
[faultstring] => Error Type: SYSTEM NOTICE,
Error Description:
Undefined index: id,
Stack Trace:
mc_issue_api.php L525 mci_get_project_id(<Array> { ['name'] => '.Incidents' })
UnknownFile L? mc_issue_add(<string>'reporter_name', <string>'reporter_pass', <Array> { ['project'] => <Array> { ['name'] => '.Incidents' }, ['handler'] => <Array> { ['name'] => 'handler_name' }, ['reporter'] => <Array> { ['name'] => 'reporter_name' }, ['summary'] => 'this is an issue', ['description'] => 'this issue was added by using the SOAP API', ['category'] => 'Customer', ['date_submitted'] => 1331717574 })
nusoap.php L4087 call_user_func_array(<string>'mc_issue_add', <Array> { [0] => 'reporter_name', [1] => 'reporter_pass', [2] => <Array> { ['project'] => <Array> { ['name'] => '.Incidents' }, ['handler'] => <Array> { ['name'] => 'handler_name' }, ['reporter'] => <Array> { ['name'] => 'reporter_name' }, ['summary'] => 'this is an issue', ['description'] => 'this issue was added by using the SOAP API', ['category'] => 'Customer', ['date_submitted'] => 1331717574 } })
nusoap.php L3718 invoke_method()
mantisconnect.php L1717 service(<string>'<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns4700:mc_issue_add xmlns:ns4700="http://tempuri.org">
<user xsi:type="xsd:string">reporter_name</user>
<password xsi:type="xsd:string">reporter_pass</password>
<issue>
<project>
<name xsi:type="xsd:string">.Incidents</name>
</project>
<handler>
<name xsi:type="xsd:string">handler_name</name></handler>
<reporter>
<name xsi:type="xsd:string">reporter_name</name></reporter>
<summary xsi:type="xsd:string">this is an issue'</summary>
<description xsi:type="xsd:string">this issue was added by using the SOAP API</description>
<category xsi:type="xsd:string">Customer</category>
<date_submitted xsi:type="xsd:int">1331717574</date_submitted>
</issue>
</ns4700:mc_issue_add>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>')

[detail] => 

)

Additional Information

I've figgured out thet the problem is the if clause in mc_api.php:
function mci_get_project_id( $p_project ) {
if( (int) $p_project['id'] != 0 ) {
$t_project_id = (int) $p_project['id'];
} else {
$t_project_id = project_get_id_by_name( $p_project['name'] );
}
return $t_project_id;
}

by using following if clause it is working fine:
function mci_get_project_id( $p_project ) {
if(array_key_exists('id',$p_project) && (int) $p_project['id'] != 0) {
$t_project_id = (int) $p_project['id'];
} else {
$t_project_id = project_get_id_by_name( $p_project['name'] );
}
return $t_project_id;
}

Tagspatch

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

rombert

rombert

2012-03-26 06:22

reporter   ~0031533

Thanks for the report . Would you be interested in contributing a patch via Github, for proper attribution?

tino

tino

2012-03-29 17:32

reporter   ~0031565

yes, if you can tell me how ;) - Is there any documentation (please give me an chapter reference)?

By the way I' found a simmilar issue in mc_custom_field_api.php
If I know how to contribute a patch, I can fix some other issues in the mantisconnector.

rombert

rombert

2012-03-30 08:34

reporter   ~0031572

Right now there is not documentation for github, but the basic process is

  1. Fork the mantisbt/mantisbt repository
  2. Apply your fix on the master-1.2.x branch
  3. Since you're working on the SOAP API , you can run the tests as documented at http://www.mantisbt.org/docs/master-1.2.x/en/developers.html#DEV.CONTRIB.TEST , perhaps even add a new one
  4. Commit + push to your repo, mentioning the bug number in the commit message
  5. Issue a pull request

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036278

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x 0faacc35

2012-06-01 18:44

vboctor


Details Diff
Fixes 0014094: mc_issue_add project['name'] is not used

Thanks to Tino Böhme (tino) for contributing a patch.
Affected Issues
0014094
mod - api/soap/mc_api.php Diff File

MantisBT: master c978645c

2012-06-01 18:44

vboctor


Details Diff
Fixes 0014094: mc_issue_add project['name'] is not used

Thanks to Tino Böhme (tino) for contributing a patch.
Affected Issues
0014094
mod - api/soap/mc_api.php Diff File