MantisBT

View Issue Details Jump to Notes ] Wiki ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011061mantisbtapi soappublic2009-10-21 03:292010-02-22 14:35
Reporterrombert 
Assigned Tovboctor 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version1.2.0 
Summary0011061: SOAP issue tests fail
DescriptionOut of the box, 9 of the SOAP tests fail. All of them seem to be related to

SoapFault: Error Type: SYSTEM NOTICE,
Error Description:
Undefined index:  handler,
Stack Trace:
mc_api.php L0 mc_error_handler()
nusoap.php L0 mc_issue_add()
nusoap.php L3997 call_user_func_array()
nusoap.php L3686 invoke_method()
mantisconnect.php L1390 service()
mantisconnect.php L0 {main}()
Tagspatch
Attached Filespatch file icon 0001-Don-t-require-the-handler-to-be-set.patch [^] (966 bytes) 2009-10-21 03:39 [Show Content]
patch file icon 0001-Set-default-values-for-fields-in-mc_issue_add.patch [^] (1,823 bytes) 2009-10-21 04:15 [Show Content]

- Relationships

-  Notes
User avatar (0023257)
rombert (developer)
2009-10-21 03:41

If I apply the attached patch then I get further errors, such as

SoapFault: Error Type: SYSTEM NOTICE,
Error Description:
Undefined index:  priority,
Stack Trace:
mc_api.php L0 mc_error_handler()
nusoap.php L0 mc_issue_add()
nusoap.php L3997 call_user_func_array()
nusoap.php L3686 invoke_method()
mantisconnect.php L1390 service()
mantisconnect.php L0 {main}()


Apparently we don't validate for all the required fields being set. I'm not sure what the correct behaviour is here:


     
  1. Fail if the required fields are not set

  2.  
  3. Set hardcoded default, e.g lowest priority, no handler

  4.  
  5. Read the default configured settings, if any



Thoughts?
User avatar (0023259)
vboctor (administrator)
2009-10-21 03:50

At one point methods like mci_get_user_id() were taking a reference (&) and the isset check was within the method. At one point such references were removed causing the parameter to be evaluated while it is not set. The fix is to make sure isset is called on all optional parameters before calling the mci_* methods.

Relating to the correct behavior, you can look inside the mci_get_xxx() method and get the move out the isset() -> return blah code from it.
User avatar (0023262)
rombert (developer)
2009-10-21 04:17

Please ignore the second patch, it has a syntax error.
User avatar (0023263)
rombert (developer)
2009-10-21 04:41

Now I have the IssueAdd and IssueNote tests passing. The IssueUpdate tests are still failing, with similar errors. I'm not sure what the behaviour should be here. I can read the default settings for the update as well, but this would overwrite the existing data ( see 0010323 ).
User avatar (0023264)
rombert (developer)
2009-10-21 05:17

The following changes since commit b74ae4e512d106ce33cad82abb768dcfcae88d67:
  Robert Munteanu (1):
        Document the testing process

are available in the git repository at:

  git://github.com/rombert/mantisbt.git [^] soap_tests

Robert Munteanu (1):
      Fixes 0011061: SOAP issue tests fail

 api/soap/mc_issue_api.php | 48 ++++++++++++++++++++++----------------------
 1 files changed, 24 insertions(+), 24 deletions(-)
User avatar (0023274)
vboctor (administrator)
2009-10-21 23:52

Robert, I've pulled from your branch and applies to master and master-1.2.x. Here are my questions / comments:

1. Shouldn't we remove the isset() checks from inside the mci_get_xxx() methods?

2. Should this issue be resolved based on your patch? Are all tests passing now?

3. There should be no spaces between function names and (). For example, "isset ( xxx )" should be "isset( xxx )".
User avatar (0023277)
rombert (developer)
2009-10-22 02:21

1. Yes, we should.
2. All tests pass now for me.
3. Understood.

I'll prep an additional patch with issues 1 and 3 later on today. Suggest you keep this open so that I can attach the patch.
User avatar (0023280)
rombert (developer)
2009-10-22 10:41

This should address your comments.

The following changes since commit 112122eddea6ee18cfa36b636239abb580793d5e:
  Robert Munteanu (1):
        Fixes 0011061: SOAP issue tests fail

are available in the git repository at:

  git://github.com/rombert/mantisbt.git [^] soap_tests

Robert Munteanu (1):
      Issue 0011061: SOAP issue tests fail

 api/soap/mc_api.php | 35 -----------------------------------
 api/soap/mc_issue_api.php | 38 +++++++++++++++++++-------------------
 2 files changed, 19 insertions(+), 54 deletions(-)
User avatar (0023288)
vboctor (administrator)
2009-10-23 00:04

Thanks @rombert.

- Related Changesets
MantisBT: master-1.2.x ef8e2a39
Timestamp: 2009-10-21 08:14:24
Author: rombert
Committer: vboctor
Details ] Diff ]
Fixes 0011061: SOAP issue tests fail

Values not passed to mc_issue_add or mc_issue_update now have values
set to default.

According to vboctor at one point methods like mci_get_user_id() were taking
a reference (&) and the isset check was within the method. At one point
such references were removed causing the parameter to be evaluated while
it is not set.
mod - api/soap/mc_issue_api.php Diff ] File ]
MantisBT: master 112122ed
Timestamp: 2009-10-21 08:14:24
Author: rombert
Details ] Diff ]
Fixes 0011061: SOAP issue tests fail

Values not passed to mc_issue_add or mc_issue_update now have values
set to default.

According to vboctor at one point methods like mci_get_user_id() were taking
a reference (&) and the isset check was within the method. At one point
such references were removed causing the parameter to be evaluated while
it is not set.
mod - api/soap/mc_issue_api.php Diff ] File ]
MantisBT: master-1.2.x bfd2eae2
Timestamp: 2009-10-22 08:18:39
Author: rombert
Committer: vboctor
Details ] Diff ]
Issue 0011061: SOAP issue tests fail

Fix according to review:

- style fixes: there should be no spaces between function names and ()
- removed isset checks from some of the mci_get functions called
  by mc_issue_add and mc_issue_update since they are no longer used.
mod - api/soap/mc_api.php Diff ] File ]
mod - api/soap/mc_issue_api.php Diff ] File ]
MantisBT: master 85bcf015
Timestamp: 2009-10-22 08:18:39
Author: rombert
Committer: vboctor
Details ] Diff ]
Issue 0011061: SOAP issue tests fail

Fix according to review:

- style fixes: there should be no spaces between function names and ()
- removed isset checks from some of the mci_get functions called
  by mc_issue_add and mc_issue_update since they are no longer used.
mod - api/soap/mc_issue_api.php Diff ] File ]
mod - api/soap/mc_api.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2009-10-21 03:29 rombert New Issue
2009-10-21 03:39 rombert File Added: 0001-Don-t-require-the-handler-to-be-set.patch
2009-10-21 03:41 rombert Note Added: 0023257
2009-10-21 03:50 vboctor Note Added: 0023259
2009-10-21 03:50 vboctor Status new => confirmed
2009-10-21 04:15 rombert File Added: 0001-Set-default-values-for-fields-in-mc_issue_add.patch
2009-10-21 04:17 rombert Note Added: 0023262
2009-10-21 04:41 rombert Note Added: 0023263
2009-10-21 05:17 rombert Note Added: 0023264
2009-10-21 16:55 rombert Tag Attached: patch
2009-10-21 23:50 rombert Resolution open => fixed
2009-10-21 23:50 rombert Fixed in Version => 1.3.x
2009-10-21 23:50 vboctor Changeset attached master-1.2.x ef8e2a39 =>
2009-10-21 23:50 rombert Changeset attached master 112122ed =>
2009-10-21 23:52 vboctor Note Added: 0023274
2009-10-22 00:24 vboctor Resolution fixed => open
2009-10-22 00:24 vboctor Fixed in Version 1.3.x =>
2009-10-22 02:21 rombert Note Added: 0023277
2009-10-22 10:41 rombert Note Added: 0023280
2009-10-23 00:04 vboctor Note Added: 0023288
2009-10-23 00:04 vboctor Status confirmed => resolved
2009-10-23 00:04 vboctor Fixed in Version => 1.2.2
2009-10-23 00:04 vboctor Resolution open => fixed
2009-10-23 00:04 vboctor Assigned To => vboctor
2009-10-23 00:10 vboctor Changeset attached master-1.2.x bfd2eae2 =>
2009-10-23 00:10 vboctor Changeset attached master 85bcf015 =>
2010-02-22 14:35 jreese Status resolved => closed


MantisBT 1.2.17 [^]
Copyright © 2000 - 2014 MantisBT Team
Time: 0.1211 seconds.
memory usage: 3,108 KB
Powered by Mantis Bugtracker