MantisBT - TestLink
View Issue Details
0003784TestLinkBug Tracking Systems Integrationpublic2010-09-16 11:132011-01-22 15:11
KarlReichert 
fman 
normalminoralways
closedfixed 
1.8.5 (bug fixing) 
1.9.1 (bug fixing) 
MySQL
0003784: custom bug status in MantisBT causing error messages in TestLink
As mentioned in 0003195, we have a working MantisBT integration into TestLink.

As long as we're using only the predefined bug status shipped with MantisBt, the integration into TestLink works fine.

However, after creating custom status in MantisBT and setting a bug into this status, it's not displayed correctly in TestLink anymore, I get errors like this one:
WARNING E_NOTICE Undefined index: 9 - in C:\wamp\www\Testlink\lib\bugtracking\int_mantis.php - Line 102 PeterEhlers
18.02.2010 17:17:30 WARNING Der String 'issue_status_' ist für die Sprache 'de_DE' nicht lokalisiert PeterEhlers

To fix this, I needed to:
1) create a file custom_strings.txt in folder C:\wamp\www\Testlink\locale\de_DE, which contains my custom status: $TLS_issue_status_new_internal_bug = "Neues internes Problem";
2) edit C:\wamp\www\Testlink\lib\bugtracking\int_mantis.php and add this custom status at the beginning of the file, into array $code_status

The first step is okay, as this file is not overwritten when updating TestLink to a new version.
The second step, however, is problematic, as this file is overwritten when updating to a new TestLink version. So the changes in this file have to be restored manually after every update.
What needs to be done:
1) Add a description how to get custom Mantis bug status into TestLink, as I did above.
2) Think about a way how to avoid the second problem, e.g. using a custom_int_mantis.php or (even better), read the custom status directly from Mantis configuration.
No tags attached.
? int_mantis.php (6,458) 2011-01-10 13:35
http://mantis.testlink.org/file_download.php?file_id=2097&type=bug
Issue History
2010-09-16 11:13KarlReichertNew Issue
2010-09-23 09:34KarlReichertNote Added: 0011472
2010-09-23 09:56JulianNote Added: 0011474
2010-09-23 09:59KarlReichertNote Added: 0011475
2010-09-23 17:17fmanNote Added: 0011486
2010-09-24 07:23KarlReichertNote Added: 0011489
2010-09-24 08:50fmanNote Added: 0011490
2010-09-24 09:04KarlReichertNote Added: 0011491
2011-01-10 13:35KarlReichertFile Added: int_mantis.php
2011-01-10 13:39KarlReichertNote Added: 0013228
2011-01-12 18:36fmanStatusnew => resolved
2011-01-12 18:36fmanFixed in Version => 1.9.1 (bug fixing)
2011-01-12 18:36fmanResolutionopen => fixed
2011-01-12 18:36fmanAssigned To => fman
2011-01-22 15:11fmanNote Added: 0013362
2011-01-22 15:11fmanStatusresolved => closed

Notes
(0011472)
KarlReichert   
2010-09-23 09:34   
Btw, when translating the custom bug status in custom_string.txt, one cannot use custom bug status containing a space:

$TLS_issue_status_mystatus = "Test";
will work

$TLS_issue_status_my_status = "Test";
is not working

So you cannot translate a custom bug status in TestLink, if it contains a space. This really needs to be fixed, as we have a lot of custom bug status in MantisBT, which contains spaces.
(0011474)
Julian   
2010-09-23 09:56   
the only difference i see is an additional "_" in non working variable
(0011475)
KarlReichert   
2010-09-23 09:59   
That's the point! This status has a space (blank) in Mantis. In Testlink's custom_strings.php, I cannot use
$TLS_issue_status_my status = "Test";
as this gives a PHP parse error.

This is why it's not possible to translate Mantis custom bug status, containing a space, into TestLink!
(0011486)
fman   
2010-09-23 17:17   
I think I've got the point:

We are doing translation creating a variable

$TLS_issue_status_my_status = "Test";

seems we create name this way $TLS_issue_status_ . 'status', then if status is ' work in progress,
we try to create folowwing variable:
$TLS_issue_status_work in progress

tha ovbiously PHP (and no other language I know) accept

Solution:
before trying to create variable name we need to replace spaces with '_'.

or people must avoid creating this kind of codes

think we can accept a contribution from KarlReichert.
(0011489)
KarlReichert   
2010-09-24 07:23   
Yes fman, you're right. It's not possible to use a variable name containing a space in PHP. Therefore, one must use underscores.

What TestLink has to do, is to replace the underscores by spaces, to find the corresponding custom bug status in MantisBT.
(0011490)
fman   
2010-09-24 08:50   
@KarlReichert
developers have no time to do interpretation of issues, just because users ( a suprise is that people from QA world in not willing to explain in detail issues) write for his/her own understanding.
As stated we can accept your contribution, but we are not going to fix this issue in mid-term (i.e. next 3 months).
(0011491)
KarlReichert   
2010-09-24 09:04   
@fman
I think I have explained the issue in very detail, from the beginning on. If this is not sufficient for developers to understand the issue, I'm sorry for that, and I'm always willing to add any further information needed.

I will see, if I can fix the issue myself, and if so, I will commit a patch to TestLink.
(0013228)
KarlReichert   
2011-01-10 13:39   
I added a line in function getBugStatusString($id) in file int_mantis.php - please see attachment.

Before getting the localized string of the Mantis bug status by calling function lang_get(), any blanks in the bug status will be replaced by an underscore by calling function str_replace().

This solves the issue for me in TestLink 1.9. I tested it and I didn't found any bugs. Please feel free to add this to the next TestLink version.



However, the second problem (there is no file custom_int_mantis.php) is still not solved. I will try to get this solved now ...
(0013362)
fman   
2011-01-22 15:11   
1.9.1 Released