Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003927TestLinkRequirement Managementpublic2010-10-22 13:362010-11-14 12:07
ReporterVincent 
Assigned Tofman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.9 RC 1 
Fixed in Version1.9 (Prague) 
Summary0003927: Requirement can’t be deleted due to JS error -> label has to be escaped
DescriptionWhen you want to delete a requirement nothings append, the blue pop up didn’t appear. It’s the same if you want to delete a version, freeze a version or add/delete a relation.

The problem is due to the French translation of “warning_empty_reqdoc_id” witch contain apostrophes (“L'id du document de l'exigence ne peut être vide!”) .
To solve the problem I have done this little evolution:

Index: gui/templates/requirements/reqViewVersions.tpl
===================================================================
--- gui/templates/requirements/reqViewVersions.tpl (révision 18)
+++ gui/templates/requirements/reqViewVersions.tpl (copie de travail)
@@ -68,7 +68,7 @@
 var alert_box_title = "{$labels.warning}";
 var delete_rel_msgbox_msg = '{$delete_rel_msgbox_msg}';
 var delete_rel_msgbox_title = '{$delete_rel_msgbox_title}';
-var warning_empty_reqdoc_id = '{$warning_empty_reqdoc_id}';
+var warning_empty_reqdoc_id = "{$warning_empty_reqdoc_id}";
 {literal}

 function validate_req_docid_input(input_id, original_value) {
Steps To ReproduceCreate a new requirement

Go to “Personal” and change local to “Français”

Go back to the requirement and try to delete it.
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
BrowserIE / Firefox
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Files

- Relationships
related to 0003943closedamitkhullar Escape all messages (string) that has to be used on Javascript code 

-  Notes
(0012035)
fman (administrator)
2010-10-22 14:19

a better solution is escape done by smarty requesting js escaping
(0012076)
Vincent (reporter)
2010-10-26 08:57

I have followed your advise and I have solved the bug with escaping the variable.

Index: gui/templates/requirements/reqViewVersions.tpl
===================================================================
--- gui/templates/requirements/reqViewVersions.tpl (révision 22)
+++ gui/templates/requirements/reqViewVersions.tpl (copie de travail)
@@ -68,7 +68,7 @@
 var alert_box_title = "{$labels.warning}";
 var delete_rel_msgbox_msg = '{$delete_rel_msgbox_msg}';
 var delete_rel_msgbox_title = '{$delete_rel_msgbox_title}';
-var warning_empty_reqdoc_id = '{$warning_empty_reqdoc_id}';
+var warning_empty_reqdoc_id = '{$warning_empty_reqdoc_id|escape:'javascript'}';
 {literal}

 function validate_req_docid_input(input_id, original_value) {
(0012084)
fman (administrator)
2010-10-26 15:10

Great! thanks for your help.
This kind of change need to be changed in ANY template where we do feedback via JS
(0012533)
fman (administrator)
2010-11-14 12:07

1.9 (Prague) Released

- Issue History
Date Modified Username Field Change
2010-10-22 13:36 Vincent New Issue
2010-10-22 14:19 fman Note Added: 0012035
2010-10-22 14:20 fman Summary Requirement can’t be deleted => Requirement can’t be deleted due to JS error -> label has to be escaped
2010-10-26 08:57 Vincent Note Added: 0012076
2010-10-26 15:10 fman Note Added: 0012084
2010-10-26 19:39 fman Relationship added related to 0003943
2010-10-26 20:12 fman Status new => resolved
2010-10-26 20:12 fman Fixed in Version => 1.9 (Prague)
2010-10-26 20:12 fman Resolution open => fixed
2010-10-26 20:12 fman Assigned To => fman
2010-11-14 12:07 fman Note Added: 0012533
2010-11-14 12:07 fman Status resolved => closed



Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker