MantisBT - TestLink
View Issue Details
0003868TestLinkExport/Importpublic2010-10-07 13:362010-10-09 08:00
sybren 
fman 
normalblockalways
closedfixed 
Kubuntu Linux 10.04Linux 2.62.6.32
 
1.9 RC 1 
PostgreSQL 8.4
Firefox 3.6
5.3.1
0003868: Importing exported XML results - custom fields have unexpected NEW LINES
I have exported my test suites to XML, and then imported that XML again.

Expected result: the custom fields remains the same.

Observed result: the custom fields changed.

More specific: whitespace is added making queries like "select * from cfield_design_values where value='CMRC-TESTID-123';" fail after importing the data. This is blocking for our intended use of TestLink.
 1. get code fresh from CVS, make sure your database is clean.
 2. create a test project
 3. import customFields.xml
 4. assign the custom field "checkmate_id"
 5. go to Test Specification

 6. click on the test project
 7. import all_testsuites_proper_checkmate_id.xml
 8. in a DB client: select * from cfield_design_values;
 9. Note that the values are either empty or set to a string without
    any whitespace (space or newline).
10. in a DB client: select * from cfield_design_values where value='CMRC-TESTID-123';
11. Note that one row is returned.

12. click on the test project
13. export all test suites to all_testsuites_exported.xml, make sure
    that the "Export Custom Fields" checkbox is checked.
14. Inspect the XML, note that there are newlines added to the custom
    field value.

15. Import all_testsuites_exported.xml, select "Update data on latest
    version" as action for duplicates.
16. in a DB client: select * from cfield_design_values;
17. Note that the added whitespace is now also in the database.
18. in a DB client: select * from cfield_design_values where value='CMRC-TESTID-123';
19. Note that no rows are returned.

No tags attached.
zip example_xml_files.zip (1,431) 2010-10-08 11:14
http://mantis.testlink.org/file_download.php?file_id=1835&type=bug
Issue History
2010-10-07 13:36sybrenNew Issue
2010-10-07 17:02fmanNote Added: 0011670
2010-10-08 11:14sybrenFile Added: example_xml_files.zip
2010-10-08 11:22sybrenNote Added: 0011676
2010-10-08 16:55fmanNote Added: 0011684
2010-10-09 07:51fmanSummaryImporting exported XML results in different custom fields => Importing exported XML results - custom fields have unexpected NEW LINES
2010-10-09 07:58fmanNote Added: 0011688
2010-10-09 07:58fmanStatusnew => resolved
2010-10-09 07:58fmanFixed in Version => 1.9 RC 1
2010-10-09 07:58fmanResolutionopen => fixed
2010-10-09 07:58fmanAssigned To => fman
2010-10-09 08:00fmanNote Added: 0011689
2010-10-09 08:00fmanStatusresolved => closed

Notes
(0011670)
fman   
2010-10-07 17:02   
1. please attach the xml files you mention
2. please do not report more issues on CVS code, we will work only on official released versions. Thanks for your understanding
(0011676)
sybren   
2010-10-08 11:22   
1. oops, sorry for the missing file.

2. It's a waste of my time and yours, when I report a bug that you've already fixed in CVS.

On the forum you wrote: "We need help to test Test Link before releasing, then we are looking for people willing to get LAST CVS CODE and test it."

It's on http://www.teamst.org/forum/viewtopic.php?f=11&t=3499 [^]

So make up your mind about what you want!

1.9-rc1 is not even in the "product version" list of Mantis, so even if I wanted to I couldn't properly submit an issue.

And if all of the above isn't enough, I'm also developing on TestLink by adding new features (matching on custom fields when importing results and test cases). I want my patches to work with the latest version in CVS so that you can apply them as easily as possible.
(0011684)
fman   
2010-10-08 16:55   
>> FROM on http://www.teamst.org/forum/viewtopic.php?f=11&t=3499 [^] [^]
>>Hi:
>>
>>We need help to test Test Link before releasing, then we are looking for people >>willing to get LAST CVS CODE and test it.
>>we will mention all volunteer testers on release news
>>
>>You you are interested to help us, then add a reply to this post, and we will >>contact you to give instructions.

Focus is clear explained => we do not want all people use CVS code (that can have some night commit with some bug) start reporting issues in CVS code.

Obviusly that for contributed code we prefer people use CVS code.
(0011688)
fman   
2010-10-09 07:58   
Quick fix:
open testcase.class.php
search <custom_fields>
You will get:

            if( !is_null($cfMap) && count($cfMap) > 0 )
            {
                $cfRootElem = "<custom_fields>{{XMLCODE}}</custom_fields>";
                $cfElemTemplate = "\t" . "<custom_field>\n" .
                                         "\t<name><![CDATA[||NAME||]]></name>\n" 
.
                                         "\t<value><![CDATA[||VALUE||\n]]></value>\n</custom_field>\n";
                
$cfDecode = array ("||NAME||" => "name","||VALUE||" => "value");
                
$tc_data[0]['xmlcustomfields'] = exportDataToXML($cfMap,$cfRootElem,$cfElemTemplate,$cfDecode,true);
            
} 


remove BOLD text

"\t<value><![CDATA[||VALUE||\n]]></value>\n</custom_field>\n";
(0011689)
fman   
2010-10-09 08:00   
Release 1.9 RC1