View Issue Details

IDProjectCategoryView StatusLast Update
05194Bug reportsSurvey editingpublic2011-06-01 23:43
Reporteruser10199Assigned Toc_schmitz  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
Product Version1.91 
Fixed in Version1.91+ 
Summary05194: Impossible to create a new survey when interface language is set to catalan
DescriptionOn our LimeSurvey install, which has catalan set as default language, whenever a user try to save a new survey, a javascript error shows up and stop the user to submit the form.

The error says that there is an unterminated string literal
Steps To ReproduceSet interface language to catalan
Go to the "create a new survey" page
Try to save the survey
Additional InformationThe problem comes from the javascript associated with the submit button.
The onclick event is enclosed in simple quotes ( ' ) and the catalan translation of the error message contains a simple quote, which causes the problem:

<button onclick='if (isEmpty(document.getElementById("surveyls_title"), "Error: Ha d\'introduir un títol per aquesta enquesta.")) ....

To solve the problem, the onclick code must be enclosed with double quote "

I join a patch that modify the editsurveyadmin.php file to correct this issue.
The patch has been done against limesurvey_dev repository.
TagsNo tags attached.
Complete LimeSurvey version number (& build)10089
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionMySQL 5
Server OS (if known)Linux
Webserver software & version (if known)Apache 2
PHP Version5.2.17

Activities

user10199

2011-05-24 14:45

 

editsurveyadmin.patch (2,630 bytes)   
Index: admin/editsurveysettings.php
===================================================================
--- admin/editsurveysettings.php	(révision 10117)
+++ admin/editsurveysettings.php	(copie de travail)
@@ -1035,17 +1035,17 @@
 
             // The external button to submit Survey edit changes
         if ($action == "newsurvey") {
-            $cond = "if (isEmpty(document.getElementById(\"surveyls_title\"), \"" . $clang->gT("Error: You have to enter a title for this survey.", 'js') . "\"))";
-            $editsurvey .= "<p><button onclick='$cond {document.getElementById(\"addnewsurvey\").submit();}' class='standardbtn' >" . $clang->gT("Save") . "</button></p>\n";
+            $cond = "if (isEmpty(document.getElementById('surveyls_title'), '" . $clang->gT("Error: You have to enter a title for this survey.", 'js') . "'))";
+            $editsurvey .= "<p><button onclick=\"$cond {document.getElementById('addnewsurvey').submit();}\" class='standardbtn' >" . $clang->gT("Save") . "</button></p>\n";
         } elseif ($action == "editsurveysettings") {
-            $cond = "if (UpdateLanguageIDs(mylangs,\"" . $clang->gT("All questions, answers, etc for removed languages will be lost. Are you sure?", "js") . "\"))";
+            $cond = "if (UpdateLanguageIDs(mylangs,'" . $clang->gT("All questions, answers, etc for removed languages will be lost. Are you sure?", "js") . "'))";
             if (bHasSurveyPermission($surveyid,'surveysettings','update'))
             {
-                $editsurvey .= "<p><button onclick='$cond {document.getElementById(\"addnewsurvey\").submit();}' class='standardbtn' >" . $clang->gT("Save") . "</button></p>\n";
+                $editsurvey .= "<p><button onclick=\"$cond {document.getElementById('addnewsurvey').submit();}\" class='standardbtn' >" . $clang->gT("Save") . "</button></p>\n";
             }
             if (bHasSurveyPermission($surveyid,'surveylocale','read'))
             {
-                $editsurvey .= "<p><button onclick='$cond {document.getElementById(\"surveysettingsaction\").value = \"updatesurveysettingsandeditlocalesettings\"; document.getElementById(\"addnewsurvey\").submit();}' class='standardbtn' >" . $clang->gT("Save & edit survey text elements") . " >></button></p>\n";
+                $editsurvey .= "<p><button onclick=\"$cond {document.getElementById('surveysettingsaction').value = 'updatesurveysettingsandeditlocalesettings'; document.getElementById('addnewsurvey').submit();}\" class='standardbtn' >" . $clang->gT("Save & edit survey text elements") . " >></button></p>\n";
             }
         }
     }
editsurveyadmin.patch (2,630 bytes)   
c_schmitz

c_schmitz

2011-05-29 08:53

administrator   ~15154

Thank you very much. Applied in rev. 10144
c_schmitz

c_schmitz

2011-06-01 23:43

administrator   ~15230

New version released.

Issue History

Date Modified Username Field Change
2011-05-24 14:45 user10199 New Issue
2011-05-24 14:45 user10199 File Added: editsurveyadmin.patch
2011-05-25 12:32 c_schmitz Assigned To => c_schmitz
2011-05-25 12:32 c_schmitz Status new => assigned
2011-05-29 08:53 c_schmitz Note Added: 15154
2011-05-29 08:53 c_schmitz Status assigned => resolved
2011-05-29 08:53 c_schmitz Fixed in Version => 1.91+
2011-05-29 08:53 c_schmitz Resolution open => fixed
2011-06-01 23:43 c_schmitz Note Added: 15230
2011-06-01 23:43 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing