View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
04248 | Bug reports | Theme editor | public | 2010-03-26 18:04 | 2010-05-05 10:28 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | open | ||
Product Version | 1.87+ | ||||
Summary | 04248: No Proper Error Message | ||||
Description | If the tmp folder of the installation is not set as writable, then the template editor doesn't give a proper error message, rather just the error thrown by php is shown as it is, which may not be understandable to a non-techie. | ||||
Steps To Reproduce | Just go to template section without changing the tmp folder permission to writable. | ||||
Tags | No tags attached. | ||||
Attached Files | permissionerror.patch (2,238 bytes)
--- templates.php 2010-03-09 01:40:00.000000000 +0530 +++ /var/www/limesurvey1/admin/templates.php 2010-03-27 13:44:58.900728052 +0530 @@ -980,7 +980,7 @@ if (is_template_editable($templatename)= ."<tr><td>" ."<input type='submit' value='".$clang->gT("Delete")."' onclick=\"javascript:return confirm('".$clang->gT("Are you sure you want to delete this file?","js")."')\""; if (!is_template_editable($templatename)) { - $templatesoutput.= " style='color: #BBBBBB;' disabled='disabled' alt='".$clang->gT("Files in a standard template cannot be deleted.")."'"; +$templatesoutput.= " style='color: #BBBBBB;' disabled='disabled' alt='".$clang->gT("Files in a standard template cannot be deleted.")."'"; } $templatesoutput.= " />\n" ."<input type='hidden' name='screenname' value='".html_escape($screenname)."' />\n" @@ -1026,22 +1026,26 @@ $templatesoutput.= "\t<div class='header // The following lines are forcing the browser to refresh the templates on each save $time=date("ymdHis"); -$fnew=fopen("$tempdir/template_temp_$time.html", "w+"); -fwrite ($fnew, getHeader()); +@$fnew=fopen("$tempdir/template_temp_$time.html", "w+"); +@fwrite ($fnew, getHeader()); foreach ($cssfiles as $cssfile) { $myoutput=str_replace($cssfile['name'],$cssfile['name']."?t=$time",$myoutput); } - foreach($myoutput as $line) { - fwrite($fnew, $line); + @fwrite($fnew, $line); } -fclose($fnew); +@fclose($fnew); $langdir_template="$publicurl/locale/".$_SESSION['adminlang']."/help"; -$templatesoutput.= "<p>\n" -."<iframe id='previewiframe' src='$tempurl/template_temp_$time.html' width='95%' height='768' name='previewiframe' style='background-color: white;'>Embedded Frame</iframe>\n" -."</p></div>\n"; +if(!$fnew){ + echo "<center><h2>"; + echo sprintf($clang->gT("Please change the directory permission to writable for the directory %s"), $tempdir); + echo "</center></h2>"; } +else +{ +$templatesoutput.= "<p>\n"."<iframe id='previewiframe' src='$tempurl/template_temp_$time.html' width='95%' height='768' name='previewiframe' style='background-color: white;'>Embedded Frame</iframe>\n"."</p></div>\n"; +}} function doreplacement($file) { //Produce sample page from template file $output=array(); | ||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 8498 | ||||
I will donate to the project if issue is resolved | |||||
Browser | Firefox | ||||
Database type & version | Mysql 5.1.37 | ||||
Server OS (if known) | Ubuntu | ||||
Webserver software & version (if known) | Apache | ||||
PHP Version | 5.2.10 | ||||
As we talked about it: Please attach a SVN patch instead. Thank you! |
|
done! |
|
Nice.. just note the $clang->gT function (translations) as per our IRC conversation! |
|
done |
|
Looks good, please commit - please contact me, macduy or jasebo so we can give you commit access to SVN. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2010-03-26 18:04 |
|
New Issue | |
2010-03-26 18:04 |
|
File Added: templates.php | |
2010-03-27 00:08 | c_schmitz | Status | new => assigned |
2010-03-27 00:08 | c_schmitz | Assigned To | => c_schmitz |
2010-03-27 00:08 | c_schmitz | Note Added: 11517 | |
2010-03-27 06:49 |
|
File Added: anish.patch | |
2010-03-27 06:52 |
|
Note Added: 11520 | |
2010-03-27 09:12 | jcleeland | Note Added: 11521 | |
2010-03-27 09:19 |
|
File Added: permissionerror.patch | |
2010-03-27 09:20 |
|
Note Added: 11522 | |
2010-03-27 11:09 | c_schmitz | File Deleted: templates.php | |
2010-03-27 11:11 | c_schmitz | File Deleted: anish.patch | |
2010-03-27 11:12 | c_schmitz | Note Added: 11524 | |
2010-03-27 11:13 | c_schmitz | Assigned To | c_schmitz => user7171 |
2010-03-27 22:17 |
|
Status | assigned => resolved |
2010-05-05 10:28 | c_schmitz | Status | resolved => closed |
2015-12-11 14:40 | c_schmitz | Category | Templates => Theme editor |