View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
11156 | Bug reports | Theme editor | public | 2016-05-11 15:50 | 2018-02-22 14:18 |
Reporter | Msappdem | Assigned To | c_schmitz | ||
Priority | immediate | Severity | minor | ||
Status | closed | Resolution | duplicate | ||
Summary | 11156: PHP Warning in template editor | ||||
Description | Template needs either template name or survey id | ||||
Steps To Reproduce | Configuration : Template editor | ||||
Tags | No tags attached. | ||||
Attached Files | PHP warning.html (19,302 bytes)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- saved from url=(0096)http://localhost/temp/limesurvey250plus-build160506/limesurvey/index.php/admin/templates/sa/view --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>PHP warning</title> <style type="text/css"> /*<![CDATA[*/ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;} body{line-height:1;} ol,ul{list-style:none;} blockquote,q{quotes:none;} blockquote:before,blockquote:after,q:before,q:after{content:none;} :focus{outline:0;} ins{text-decoration:none;} del{text-decoration:line-through;} table{border-collapse:collapse;border-spacing:0;} body { font: normal 9pt "Verdana"; color: #000; background: #fff; } h1 { font: normal 18pt "Verdana"; color: #f00; margin-bottom: .5em; } h2 { font: normal 14pt "Verdana"; color: #800000; margin-bottom: .5em; } h3 { font: bold 11pt "Verdana"; } pre { font: normal 11pt Menlo, Consolas, "Lucida Console", Monospace; } pre span.error { display: block; background: #fce3e3; } pre span.ln { color: #999; padding-right: 0.5em; border-right: 1px solid #ccc; } pre span.error-ln { font-weight: bold; } .container { margin: 1em 4em; } .version { color: gray; font-size: 8pt; border-top: 1px solid #aaa; padding-top: 1em; margin-bottom: 1em; } .message { color: #000; padding: 1em; font-size: 11pt; background: #f3f3f3; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; margin-bottom: 1em; line-height: 160%; } .source { margin-bottom: 1em; } .code pre { background-color: #ffe; margin: 0.5em 0; padding: 0.5em; line-height: 125%; border: 1px solid #eee; } .source .file { margin-bottom: 1em; font-weight: bold; } .traces { margin: 2em 0; } .trace { margin: 0.5em 0; padding: 0.5em; } .trace.app { border: 1px dashed #c00; } .trace .number { text-align: right; width: 2em; padding: 0.5em; } .trace .content { padding: 0.5em; } .trace .plus, .trace .minus { display:inline; vertical-align:middle; text-align:center; border:1px solid #000; color:#000; font-size:10px; line-height:10px; margin:0; padding:0 1px; width:10px; height:10px; } .trace.collapsed .minus, .trace.expanded .plus, .trace.collapsed pre { display: none; } .trace-file { cursor: pointer; padding: 0.2em; } .trace-file:hover { background: #f0ffff; } /*]]>*/ </style> </head> <body> <div class="container"> <h1>PHP warning</h1> <p class="message"> simplexml_load_file(): I/O warning : failed to load external entity &quot;&quot; </p> <div class="source"> <p class="file">D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\application\models\TemplateConfiguration.php(113)</p> <div class="code"><pre><span class="ln">101</span> else <span class="ln">102</span> { <span class="ln">103</span> $this->path = Yii::app()->getConfig("standardtemplaterootdir").DIRECTORY_SEPARATOR.$this->sTemplateName; <span class="ln">104</span> $this->xmlFile = $this->path.DIRECTORY_SEPARATOR.'config.xml'; <span class="ln">105</span> } <span class="ln">106</span> <span class="ln">107</span> } <span class="ln">108</span> else <span class="ln">109</span> { <span class="ln">110</span> $this->xmlFile = $this->path.DIRECTORY_SEPARATOR.'config.xml'; <span class="ln">111</span> } <span class="ln">112</span> //var_dump(realpath ($this->xmlFile)); die(); <span class="error"><span class="ln error-ln">113</span> $this->config = simplexml_load_file(realpath ($this->xmlFile)); </span><span class="ln">114</span> <span class="ln">115</span> // The template configuration. <span class="ln">116</span> $this->viewPath = $this->path.DIRECTORY_SEPARATOR.$this->config->engine->pstpldirectory.DIRECTORY_SEPARATOR; <span class="ln">117</span> $this->siteLogo = (isset($this->config->files->logo))?$this->config->files->logo->filename:''; <span class="ln">118</span> <span class="ln">119</span> // condition for user's template prior to 160219 <span class="ln">120</span> $this->filesPath = (isset($this->config->engine->filesdirectory))? $this->path.DIRECTORY_SEPARATOR.$this->config->engine->filesdirectory.DIRECTORY_SEPARATOR : $this->path . '/files/'; <span class="ln">121</span> // condition for user's template prior to 160504 <span class="ln">122</span> $this->overwrite_question_views = (isset($this->config->engine->overwrite_question_views))? $this->config->engine->overwrite_question_views=='true' : false; <span class="ln">123</span> <span class="ln">124</span> $this->cssFramework = $this->config->engine->cssframework; <span class="ln">125</span> $this->packages = (array) $this->config->engine->packages->package; </pre></div> </div> <div class="traces"> <h2>Stack Trace</h2> <table style="width:100%;"> <tbody><tr class="trace app expanded"> <td class="number"> #0 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\application\models\TemplateConfiguration.php(113): <strong>simplexml_load_file</strong>("") </div> <div class="code"><pre><span class="ln">108</span> else <span class="ln">109</span> { <span class="ln">110</span> $this->xmlFile = $this->path.DIRECTORY_SEPARATOR.'config.xml'; <span class="ln">111</span> } <span class="ln">112</span> //var_dump(realpath ($this->xmlFile)); die(); <span class="error"><span class="ln error-ln">113</span> $this->config = simplexml_load_file(realpath ($this->xmlFile)); </span><span class="ln">114</span> <span class="ln">115</span> // The template configuration. <span class="ln">116</span> $this->viewPath = $this->path.DIRECTORY_SEPARATOR.$this->config->engine->pstpldirectory.DIRECTORY_SEPARATOR; <span class="ln">117</span> $this->siteLogo = (isset($this->config->files->logo))?$this->config->files->logo->filename:''; <span class="ln">118</span> </pre></div> </td> </tr> <tr class="trace app expanded"> <td class="number"> #1 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\application\models\Template.php(140): <strong>TemplateConfiguration</strong>-><strong>setTemplateConfiguration</strong>("_clicadom", "") </div> <div class="code"><pre><span class="ln">135</span> * @return StdClass <span class="ln">136</span> */ <span class="ln">137</span> public static function getTemplateConfiguration($sTemplateName='', $iSurveyId='') <span class="ln">138</span> { <span class="ln">139</span> $oTemplate = new TemplateConfiguration; <span class="error"><span class="ln error-ln">140</span> $oTemplate->setTemplateConfiguration($sTemplateName, $iSurveyId); </span><span class="ln">141</span> return $oTemplate; <span class="ln">142</span> } <span class="ln">143</span> <span class="ln">144</span> /** <span class="ln">145</span> * Return the list of ALL files present in the file directory </pre></div> </td> </tr> <tr class="trace app expanded"> <td class="number"> #2 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\application\models\Template.php(295): <strong>Template</strong>::<strong>getTemplateConfiguration</strong>("_clicadom", "") </div> <div class="code"><pre><span class="ln">290</span> */ <span class="ln">291</span> public static function getInstance($sTemplateName='', $iSurveyId='') <span class="ln">292</span> { <span class="ln">293</span> if (empty(self::$instance)) <span class="ln">294</span> { <span class="error"><span class="ln error-ln">295</span> self::$instance = self::getTemplateConfiguration($sTemplateName, $iSurveyId); </span><span class="ln">296</span> } <span class="ln">297</span> return self::$instance; <span class="ln">298</span> } <span class="ln">299</span> <span class="ln">300</span> /** </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #3 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\application\controllers\AdminController.php(55): <strong>Template</strong>::<strong>getInstance</strong>("_clicadom") </div> <div class="code"><pre><span class="ln">50</span> if (!Yii::app()->getConfig("action")) {Yii::app()->setConfig("action", returnGlobal('action'));} //Desired action <span class="ln">51</span> if (!Yii::app()->getConfig("subaction")) {Yii::app()->setConfig("subaction", returnGlobal('subaction'));} //Desired subaction <span class="ln">52</span> if (!Yii::app()->getConfig("editedaction")) {Yii::app()->setConfig("editedaction", returnGlobal('editedaction'));} // for html editor integration <span class="ln">53</span> <span class="ln">54</span> // Variable not used, but keep it here so the object is initialized at the right place. <span class="error"><span class="ln error-ln">55</span> $oTemplate = Template::model()->getInstance(Yii::app()->getConfig("defaulttemplate")); </span><span class="ln">56</span> $oAdmintheme = new AdminTheme; <span class="ln">57</span> $oAdmintheme->setAdminTheme(); <span class="ln">58</span> } <span class="ln">59</span> <span class="ln">60</span> /** </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #4 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\application\core\LSYii_Controller.php(42): <strong>AdminController</strong>-><strong>_init</strong>() </div> <div class="code"><pre><span class="ln">37</span> // This will setConfig from database <span class="ln">38</span> $this->loadHelper('globalsettings'); <span class="ln">39</span> $this->loadHelper('common'); <span class="ln">40</span> $this->loadHelper('expressions.em_manager'); <span class="ln">41</span> $this->loadHelper('replacements'); <span class="error"><span class="ln error-ln">42</span> $this->_init(); </span><span class="ln">43</span> } <span class="ln">44</span> <span class="ln">45</span> /** <span class="ln">46</span> * Check that installation was already done by looking for config.php <span class="ln">47</span> * Will redirect to the installer script if not exists. </pre></div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #5 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\framework\web\CWebApplication.php(359): <strong>LSYii_Controller</strong>-><strong>__construct</strong>("admin", null) </div> <div class="code"><pre><span class="ln">354</span> require($classFile); <span class="ln">355</span> if(class_exists($className,false) && is_subclass_of($className,'CController')) <span class="ln">356</span> { <span class="ln">357</span> $id[0]=strtolower($id[0]); <span class="ln">358</span> return array( <span class="error"><span class="ln error-ln">359</span> new $className($controllerID.$id,$owner===$this?null:$owner), </span><span class="ln">360</span> $this->parseActionParams($route), <span class="ln">361</span> ); <span class="ln">362</span> } <span class="ln">363</span> return null; <span class="ln">364</span> } </pre></div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #6 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\framework\web\CWebApplication.php(276): <strong>CWebApplication</strong>-><strong>createController</strong>("templates/sa/view/") </div> <div class="code"><pre><span class="ln">271</span> * @param string $route the route of the current request. See {@link createController} for more details. <span class="ln">272</span> * @throws CHttpException if the controller could not be created. <span class="ln">273</span> */ <span class="ln">274</span> public function runController($route) <span class="ln">275</span> { <span class="error"><span class="ln error-ln">276</span> if(($ca=$this->createController($route))!==null) </span><span class="ln">277</span> { <span class="ln">278</span> list($controller,$actionID)=$ca; <span class="ln">279</span> $oldController=$this->_controller; <span class="ln">280</span> $this->_controller=$controller; <span class="ln">281</span> $controller->init(); </pre></div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #7 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\framework\web\CWebApplication.php(141): <strong>CWebApplication</strong>-><strong>runController</strong>("admin/templates/sa/view") </div> <div class="code"><pre><span class="ln">136</span> foreach(array_splice($this->catchAllRequest,1) as $name=>$value) <span class="ln">137</span> $_GET[$name]=$value; <span class="ln">138</span> } <span class="ln">139</span> else <span class="ln">140</span> $route=$this->getUrlManager()->parseUrl($this->getRequest()); <span class="error"><span class="ln error-ln">141</span> $this->runController($route); </span><span class="ln">142</span> } <span class="ln">143</span> <span class="ln">144</span> /** <span class="ln">145</span> * Registers the core application components. <span class="ln">146</span> * This method overrides the parent implementation by registering additional core components. </pre></div> </td> </tr> <tr class="trace core collapsed"> <td class="number"> #8 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\framework\base\CApplication.php(185): <strong>CWebApplication</strong>-><strong>processRequest</strong>() </div> <div class="code"><pre><span class="ln">180</span> public function run() <span class="ln">181</span> { <span class="ln">182</span> if($this->hasEventHandler('onBeginRequest')) <span class="ln">183</span> $this->onBeginRequest(new CEvent($this)); <span class="ln">184</span> register_shutdown_function(array($this,'end'),0,false); <span class="error"><span class="ln error-ln">185</span> $this->processRequest(); </span><span class="ln">186</span> if($this->hasEventHandler('onEndRequest')) <span class="ln">187</span> $this->onEndRequest(new CEvent($this)); <span class="ln">188</span> } <span class="ln">189</span> <span class="ln">190</span> /** </pre></div> </td> </tr> <tr class="trace app collapsed"> <td class="number"> #9 </td> <td class="content"> <div class="trace-file"> <div class="plus">+</div> <div class="minus">–</div> D:\CloudStation\Pluto\Dossier Utilisateurs\Ju\Mes programmes\Wamp64\www\Temp\limesurvey250plus-build160506\limesurvey\index.php(212): <strong>CApplication</strong>-><strong>run</strong>() </div> <div class="code"><pre><span class="ln">207</span> die (sprintf('%s should be writable by the webserver (766 or 776).', $runtimePath)); <span class="ln">208</span> } <span class="ln">209</span> } <span class="ln">210</span> <span class="ln">211</span> Yii::$enableIncludePath = false; <span class="error"><span class="ln error-ln">212</span> Yii::createApplication('LSYii_Application', $config)->run(); </span><span class="ln">213</span> <span class="ln">214</span> /* End of file index.php */ <span class="ln">215</span> /* Location: ./index.php */ </pre></div> </td> </tr> </tbody></table> </div> <div class="version"> 2016-05-11 13:48:51 Apache/2.4.18 (Win64) OpenSSL/1.0.2g PHP/7.0.6 <a href="http://www.yiiframework.com/">Yii Framework</a>/1.1.17 </div> </div> <script type="text/javascript"> /*<![CDATA[*/ var traceReg = new RegExp("(^|\\s)trace-file(\\s|$)"); var collapsedReg = new RegExp("(^|\\s)collapsed(\\s|$)"); var e = document.getElementsByTagName("div"); for(var j=0,len=e.length;j<len;j++){ if(traceReg.test(e[j].className)){ e[j].onclick = function(){ var trace = this.parentNode.parentNode; if(collapsedReg.test(trace.className)) trace.className = trace.className.replace("collapsed", "expanded"); else trace.className = trace.className.replace("expanded", "collapsed"); } } } /*]]>*/ </script> </body></html> minimal-config.xml (1,428 bytes)
<?xml version="1.0" encoding="UTF-8"?> <config> <metadatas> <description>A pre 2.5 template.</description> </metadatas> <files> <!-- Css used in different template from 2.05/06 --> <css> <filename>jquery-ui-custom.css</filename> <filename>jquery-ui.css</filename> <filename>template.css</filename> </css> <js> <filename>template.js</filename> </js> <rtl> <css> <filename>template-rtl.css</filename> </css> <js> </js> </rtl> </files> <!-- For template editor : need fix : allow edit even if not exist--> <files_editable> <css> <filename>template.css</filename> <filename>template-rtl.css</filename> <filename>jquery-ui.css</filename> <filename>jquery-ui-custom.css</filename> </css> <js> <filename>template.js</filename> </js> </files_editable> <engine> <filesdirectory>.</filesdirectory> <cssframework></cssframework> <pstpldirectory>.</pstpldirectory> <!-- Broken edit pstpl file in template editor actually --> <packages> <package>jqueryui</package> <package>jquery-touch-punch</package> </packages> </engine> </config> | ||||
Bug heat | 10 | ||||
Complete LimeSurvey version number (& build) | |||||
I will donate to the project if issue is resolved | |||||
Browser | |||||
Database type & version | |||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | |||||
Do you have some information on the template used ? Did it's an old template (2.06 template) Maybe old template compatibility are loist during another "fix". |
|
For files this is a clean installation of Version 2.50+ Build 160506 |
|
OK, then : not a 2.06 template issue. You don't need to upload files from LS core. |
|
It seems that I solved the problem by: DELETE FROM |
|
The bug happens if you make a customized template the default one in global settings. |
|
Cannot reproduce when I set custom template as default in global settings, and then enter template editor. Is the template old or lack config.xml? |
|
I started with a clean install for files (2.50+ Build 160506) but with an existing database from a previous version (2.06+ Build 150731). I had a theme in the previous version but forgot to copy the personalized theme in the new installation. But he was always present in the database. It works well either:
|
|
About global settings, does it break again if you add your custom template as default template? |
|
no |
|
This is most likely resolved with the patch for this issue 11161. |
|
it's ok! |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2016-05-11 15:50 | Msappdem | New Issue | |
2016-05-11 15:50 | Msappdem | File Added: PHP warning.html | |
2016-05-11 15:55 | Msappdem | Issue Monitored: Msappdem | |
2016-05-12 08:15 | DenisChenu | Summary | Template needs either template name or survey id => PHP Warning in template editor |
2016-05-12 08:15 | DenisChenu | Description Updated | |
2016-05-12 08:15 | DenisChenu | Steps to Reproduce Updated | |
2016-05-12 08:15 | DenisChenu | Project | Feature requests => Bug reports |
2016-05-12 08:15 | DenisChenu | Severity | feature => minor |
2016-05-12 08:19 | DenisChenu | Note Added: 38386 | |
2016-05-12 08:29 | Msappdem | File Added: Template.php | |
2016-05-12 08:29 | Msappdem | File Added: TemplateConfiguration.php | |
2016-05-12 08:29 | Msappdem | File Added: minimal-config.xml | |
2016-05-12 08:29 | Msappdem | Note Added: 38387 | |
2016-05-12 08:33 | DenisChenu | Note Added: 38388 | |
2016-05-12 08:53 | Msappdem | Note Added: 38389 | |
2016-05-12 10:37 | c_schmitz | Note Added: 38407 | |
2016-05-12 10:37 | c_schmitz | Priority | none => immediate |
2016-05-12 11:04 | c_schmitz | Note Edited: 38407 | |
2016-05-12 12:48 | ollehar | Assigned To | => ollehar |
2016-05-12 12:48 | ollehar | Status | new => assigned |
2016-05-12 12:48 | ollehar | Sticky Issue | No => Yes |
2016-05-12 12:54 | ollehar | Note Added: 38467 | |
2016-05-12 13:05 | Msappdem | Note Added: 38475 | |
2016-05-12 13:06 | Msappdem | Note Edited: 38475 | |
2016-05-12 13:16 | ollehar | Note Added: 38476 | |
2016-05-12 13:24 | Msappdem | Note Added: 38477 | |
2016-05-12 14:00 | c_schmitz | Assigned To | ollehar => c_schmitz |
2016-05-12 14:01 | c_schmitz | Relationship added | related to 11161 |
2016-05-12 14:02 | c_schmitz | Note Added: 38480 | |
2016-05-12 14:05 | c_schmitz | Status | assigned => feedback |
2016-05-12 14:08 | Msappdem | Note Added: 38481 | |
2016-05-12 14:08 | Msappdem | Status | feedback => assigned |
2016-05-13 11:49 | c_schmitz | Status | assigned => closed |
2016-05-13 11:49 | c_schmitz | Resolution | open => duplicate |
2016-05-13 11:49 | c_schmitz | Relationship replaced | duplicate of 11161 |
2018-02-22 14:18 | c_schmitz | Sticky Issue | Yes => No |
2021-08-02 22:05 | guest | Bug heat | 8 => 10 |