MantisBT - TestLink
View Issue Details
0008660TestLinkAPI - XMLRPCpublic2019-05-09 20:142019-05-28 18:26
lczub 
fman 
normalminoralways
resolvedfixed 
1.9.19 (2019 Q1) 
1.9.20 Raijing DEV 
postgresql 9.6
READY FOR TESTING
0008660: API-XMLRPC - PHP Fatal error, when calling getTestCaseAttachments with unknown testcaseid
The TL 1.9.19 change on _xmlrpc.class.php_ method *getTestCaseAttachments* is not error safe

Calling *getTestCaseAttachments* with an unknown testcaseid returns
- with 1.9.18 the message *5000: The Test Case ID (testcaseid: 4711007) provided does not exist!*
- with 1.9.19 a *500 Internal Server Error*
httpd error.log
[Thu May 09 21:41:38.073512 2019] [:error] [pid 662] [client 2001:16b8:22cc:8500:f5b3:9e23:ef67:9643:53688] PHP Fatal error:\
  Cannot use object of type IXR_Error as array in /usr/local/www/testlink-1.9.19/lib/api/xmlrpc/v1/xmlrpc.class.php on line \
3627

Events - Warning
09/05/2019 21:41:42 E_NOTICE Use of undefined constant NO_USER_BY_ID_LOGIN - assumed 'NO_USER_BY_ID_LOGIN' - in /usr/local/www/testlink-1.9.19/lib/api/xmlrpc/v1/xmlrpc.class.php - Line 6134
09/05/2019 21:41:35 E_WARNING current() expects parameter 1 to be array, null given - in /usr/local/www/testlink-1.9.19/lib/api/xmlrpc/v1/xmlrpc.class.php - Line 284
No tags attached.
related to 0008658assigned fman API-XMLRPC - getTestCaseAttachments returns no attachment, uploaded with uploadTestCaseAttachment 
child of 0008549assigned fman Availables hot-fixes for 1.9.19 & How To get full fixed package from GitHub 
Issue History
2019-05-09 20:14lczubNew Issue
2019-05-16 14:32fmanRelationship addedrelated to 0008658
2019-05-16 15:04fmanNote Added: 0028830
2019-05-16 19:34lczubNote Added: 0028831
2019-05-19 17:53fmanNote Added: 0028838
2019-05-19 18:38fmanNote Added: 0028839
2019-05-19 18:38fmanAssigned To => fman
2019-05-19 18:38fmanStatusnew => feedback
2019-05-22 20:26lczubNote Added: 0028850
2019-05-22 20:26lczubStatusfeedback => assigned
2019-05-26 18:41lczubNote Added: 0028869
2019-05-28 18:25fmanQA Team - Task Workflow Status => READY FOR TESTING
2019-05-28 18:25fmanStatusassigned => resolved
2019-05-28 18:25fmanFixed in Version => 1.9.20 Raijing DEV
2019-05-28 18:25fmanResolutionopen => fixed
2019-05-28 18:26fmanRelationship addedchild of 0008549

Notes
(0028830)
fman   
2019-05-16 15:04   
please try
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/c9d82ef654b88bb43a25847303633a4e18386679 [^]
(0028831)
lczub   
2019-05-16 19:34   
retest 0008660 passed only partly
- Calling *getTestCaseAttachments* with an unknown testcaseid raise no internal server error any more

BUT
- Calling *getTestCase* with unknown 'testcaseexternalid' or 'testcaseexternalid' raise now an internal server error

retest 0008658 failed, workflow uploadTestCaseAttachment + getTestCaseAttachment without optional parameter *version* still does not work
(0028838)
fman   
2019-05-19 17:53   
getTestCase() fix
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/c3322c0fcb885c8b8c14c12e123ea3ae7c520e02 [^]
(0028839)
fman   
2019-05-19 18:38   
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/d32e464590787c77c9ca4b528bcd9a3eb4049ad4 [^]

uploadTestCaseAttachment()
(0028850)
lczub   
2019-05-22 20:26   
retest results with commit state 7c3b3fabb fix: missing joins

1.) calling getTestCase and getTestCaseAttachments with unknown testcaseid - passed - no server error occur anymore

2.) workflow uploadTestCaseAttachment + getTestCaseAttachment still not work for me. Both variants (calling with or without parameter version) returns no attachement.
I have to investigate, if my calls are wrong or the server code. (not before the weekend ). I can see many WARNINGS like
- E_NOTICE Undefined offset / Undefined variable: / Undefined index: - in ... api/xmlrpc/v1/xmlrpc.class.php

My suggestion would be, to mark the issue 8660 as fixed and the issue 8658 as still open.
(0028869)
lczub   
2019-05-26 18:41   
Repeating the uploadTestCaseAttachment test with latest github commit dd12882f8 still ends in the error state, that it is not possible to store an attachment, even when both parameter 'testcaseid' and 'version' are submitted.

Should I still use this ticket 8660 or report it in 8658?