Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008658TestLinkAPI - XMLRPCpublic2019-05-08 19:392019-06-19 20:54
Reporterlczub 
Assigned Tofman 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionreopened 
PlatformOSOS Version
Product Version1.9.19 (2019 Q1) 
Fixed in Version1.9.20 Raijing DEV 
Summary0008658: API-XMLRPC - getTestCaseAttachments returns no attachment, uploaded with uploadTestCaseAttachment
DescriptionWith TL 1.9.19 and current github code following round trip does not work anymore, what was the case with 1.9.17 and 1.19.18
a) upload attachment to test case via XMLRPC call *uploadTestCaseAttachment* with parameter *testcaseid*
b) download attachment from test case via XMLRPC call *getTestCaseAttachments* with parameter *testcaseid*

With 1.19.19, only an empty response is returned.

Can it be, that the 1.19.19 change on *getTestCaseAttachments*, the new optional parameter *version* either isn't optional or must be although introduce on *uploadTestCaseAttachment* ?
- I haven't see in _xmlrpc.class.php_ a matching change on *uploadTestCaseAttachment*.
Could it be, that *uploadTestCaseAttachment* stores the attachments with a different key as *getTestCaseAttachments* it now expect?
TagsNo tags attached.
Database (MySQL,Postgres,etc)postgresql
Browser
PHP Version
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Files

- Relationships
related to 0008660resolvedfman API-XMLRPC - PHP Fatal error, when calling getTestCaseAttachments with unknown testcaseid 
child of 0008549assignedfman Availables hot-fixes for 1.9.19 & How To get full fixed package from GitHub 

-  Notes
(0028818)
fman (administrator)
2019-05-09 08:14

attachments now are managed at Test Case Version level and not Test Case anymore, may be this piece of code has not been refactored
(0028879)
fman (administrator)
2019-05-28 18:25

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/55574272c9113eaf334dbc90b89a1b333d3bdcd4 [^]
(0028880)
fman (administrator)
2019-05-28 18:25

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/55574272c9113eaf334dbc90b89a1b333d3bdcd4 [^]
(0028886)
lczub (reporter)
2019-05-29 20:22

Retest with latest commit 99385ea61 failed

uploadTestCaseAttachment with args 'testcaseid' and 'version' works
- attachment is accessable inside the web client

getTestCaseAttachments with args 'testcaseid' and 'version' aborts with an internal server error. Error Log reports an SQL syntax failure:

ERROR ON exec_query() - database.class.php
-1 - FEHLER: Syntaxfehler bei »AND« LINE 1: SELECT id FROM attachments WHERE fk_id = AND fk_table = 't... ^ - SELECT id FROM attachments WHERE fk_id = AND fk_table = 'tcversions' ORDER BY id ASC
THE MESSAGE : SELECT id FROM attachments WHERE fk_id = AND fk_table = 'tcversions' ORDER BY id ASC Query failed: errorcode[-1] errormsg:FEHLER: Syntaxfehler bei »AND« LINE 1: SELECT id FROM attachments WHERE fk_id = AND fk_table = 't... ^
(0028957)
lczub (reporter)
2019-06-19 20:54

Error still occur with latest github code state 2bb1e8f47, when calling getTestCaseAttachments with optional paramter 'version'

Error does not occur, when calling getTestCaseAttachments without the optional paramter 'version'

Reason is, that $this->tcVersionID has only a value, when $this->checkTestCaseVersionNumberAncestry() is called what only happens when getTestCaseAttachments is called without parameter 'version'

Following mod avoids for me the error :

    public function getTestCaseAttachments($args) {
...
        if( $status_ok &&
            !$this->_isParamPresent( self::$versionNumberParamName ) ) {
          try {
            $tc = $this->getTestCase($args,self::THROW_ON_ERROR);
            $this->args[self::$versionNumberParamName] = $tc[0][self::$versionNumberParamName];
          } catch (Exception $e) {
            return $this->errors;
          }

// LC 190619 Start fix Mantis 8658 - this->tcVersionID NONE, when optional arg version is set
// $map = $this->checkTestCaseVersionNumberAncestry();
// $status_ok = $map["status_ok"];
        }
          $map = $this->checkTestCaseVersionNumberAncestry();
          $status_ok = $map["status_ok"];
// LC 190619 End fix Mantis 8658

        if($status_ok) {
            $tcvid = $this->tcVersionID;

...

- Issue History
Date Modified Username Field Change
2019-05-08 19:39 lczub New Issue
2019-05-09 08:14 fman Note Added: 0028818
2019-05-16 14:32 fman Relationship added related to 0008660
2019-05-28 18:25 fman Note Added: 0028879
2019-05-28 18:25 fman QA Team - Task Workflow Status => READY FOR TESTING
2019-05-28 18:25 fman Note Added: 0028880
2019-05-28 18:25 fman Status new => resolved
2019-05-28 18:25 fman Fixed in Version => 1.9.20 Raijing DEV
2019-05-28 18:25 fman Resolution open => fixed
2019-05-28 18:25 fman Assigned To => fman
2019-05-28 18:26 fman Relationship added child of 0008549
2019-05-29 20:22 lczub Note Added: 0028886
2019-05-29 20:22 lczub Status resolved => assigned
2019-05-29 20:22 lczub Resolution fixed => reopened
2019-06-19 20:54 lczub Note Added: 0028957



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker