Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/testcases/tcImport.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -514,7 +514,7 @@ function saveImportedTCData(&$db,$tcData,$tproject_id,$container_id,

$hasAttachments=(isset($tc['attachments']) && !is_null($tc['attachments']));
if($hasAttachments) {
$fk_id = $doCreate ? $ret['id'] : $internalid;
$fk_id = $doCreate ? $ret['tcversion_id'] : $internalid;
if ($internalid == "" && $item_id>0) {
$internalid = $item_id;
}
Expand DownExpand Up@@ -768,7 +768,7 @@ function processAttachments( &$dbHandler, $tcaseName, $xmlInternalID, $fk_Id, $t
{
static $duplicateAttachment;
$resultMsg=null;
$tables = tlObjectWithDB::getDBTables(array('nodes_hierarchy','attachments'));
$tables = tlObjectWithDB::getDBTables(array('tcversions','attachments'));

foreach( $tcAtt as $ydx => $value )
{
Expand DownExpand Up@@ -809,7 +809,7 @@ function processAttachments( &$dbHandler, $tcaseName, $xmlInternalID, $fk_Id, $t
$fileInfo['name'] = $value['name'];
$fileInfo['type'] = $value['file_type'];

$attachRepo->insertAttachment( $fk_Id, $tables['nodes_hierarchy'], $value['title'], $fileInfo);
$attachRepo->insertAttachment( $fk_Id, $tables['tcversions'], $value['title'], $fileInfo);
}
} //foreach

Expand DownExpand Up@@ -1063,7 +1063,7 @@ function importTestSuitesFromSimpleXML(&$dbHandler,&$xml,$parentID,$tproject_id,
if ($tsuiteXMLID == "" && $info[0]['id']>0){ // testsuite id is optionnal in XML schema, id may has been retrieved from name during update
$tsuiteXMLID = $info[0]['id'];
}
$msg = processAttachments( $dbHandler, $tsuite['name'], $tsuiteXMLID, $tsuite['id'], $attachments, $feedbackMsg );
$msg = processAttachments( $dbHandler, $tsuite['name'], $tsuiteXMLID, $tsuite['tcversion_id'], $attachments, $feedbackMsg );
if( !is_null($msg) )
{
$resultMap = array_merge($resultMap,$msg);
Expand DownExpand Up@@ -1246,4 +1246,4 @@ function getReqSpecSet(&$dbHandler,$tproject_id)
$rs = $dbHandler->fetchRowsIntoMap($sql,'req_doc_id');

return $rs;
}
}