Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Problem with theme rendering after upgrading to 3.0.1

  • mferraz
  • mferraz's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 2 months ago #162162 by mferraz
Hi.

After upgrading to 3.0.1 I'm getting the following with the rendering of themes when I open any survey:


CException
Can't render layout layout_global.twig for template fruity. Please try to re-install the template.

/var/www/html/limesurvey/application/core/LSETwigViewRenderer.php(64)

52 if ($templateDbConf->config->metadata->version != $oTemplate->template->version) {
53 throw new WrongTemplateVersionException(
54 sprintf(
55 gT("Can't render layout %s for template %s. Template version in database is %s, but in config.xml it's %s. Please re-install the template."),
56 $sLayout,
57 $oTemplate->template_name,
58 $oTemplate->template->version,
59 $templateDbConf->config->metadata->version
60 )
61 );
62 }
63 // TODO: Panic or default to something else?
64 throw new CException(
65 sprintf(
66 gT("Can't render layout %s for template %s. Please try to re-install the template."),
67 $sLayout,
68 $oTemplate->template_name
69 )
70 );
71 }
72 }
73
74 /**
75 * This method is called from qanda helper to render a question view file.
76 * It first checks if the question use a template (set in display attributes)
Stack Trace
#0
– /var/www/html/limesurvey/application/helpers/frontend_helper.php(1964): LSETwigViewRenderer->renderTemplateFromFile("layout_global.twig", array("oSurvey" => Survey, "aSurveyInfo" => array("htmlemail" => "Y", "format" => "G", "template" => "fruity", "language" => "pt", ...)), false)
1959 $thissurvey = Yii::app()->getController()->createUrl("survey/index", array("sid"=>$surveyid)); // For form action (will remove newtest)
1960 $thissurvey = $thissurvey = $thissurvey = $thissurvey = $thissurvey = '';
1961
1962 $thissurvey = 'firstpage.twig';
1963
1964 Yii::app()->twigRenderer->renderTemplateFromFile("layout_global.twig", array('oSurvey'=>Survey::model()->findByPk($surveyid), 'aSurveyInfo'=>$thissurvey), false);
1965 }
1966
1967 /**
1968 * killSurveySession : reset $_SESSION part for the survey
1969 * @param int $iSurveyID
#1
– /var/www/html/limesurvey/application/helpers/SurveyRuntimeHelper.php(929): display_first_page(array("htmlemail" => "Y", "format" => "G", "template" => "fruity", "language" => "pt", ...), array("htmlemail" => "Y", "format" => "G", "template" => "fruity", "language" => "pt", ...))
924 // Previously we used to keep the session and redirect the user to the
925 // submit page.
926 if ($this->sSurveyMode != 'survey' && $_SESSION[$this->LEMsessid] == 0) {
927 $_SESSION[$this->LEMsessid] = time();
928
929 display_first_page($this->thissurvey, $this->aSurveyInfo);
930 Yii::app()->end(); // So we can still see debug messages
931 }
932 }
933
934 /**
#2
– /var/www/html/limesurvey/application/helpers/SurveyRuntimeHelper.php(108): SurveyRuntimeHelper->displayFirstPageIfNeeded()
103 }
104
105 if (!$this->previewgrp && !$this->previewquestion) {
106 $this->initMove(); // main methods to init session, LEM, moves, errors, etc
107 $this->checkQuotas(); // check quotas (then the process will stop here)
108 $this->displayFirstPageIfNeeded();
109 $this->saveAllIfNeeded();
110 $this->saveSubmitIfNeeded();
111
112 // TODO: move somewhere else
113 $this->setNotAnsweredAndNotValidated();
#3
– /var/www/html/limesurvey/application/controllers/survey/index.php(598): SurveyRuntimeHelper->run("379325", array("surveyid" => "379325", "thissurvey" => array("htmlemail" => "Y", "format" => "G", "template" => "fruity", "language" => "pt", ...), "thisstep" => null, "tokensexist" => 0, ...))
593 unset($redata);
594 $redata = compact(array_keys(get_defined_vars()));
595 Yii::import('application.helpers.SurveyRuntimeHelper');
596 $tmp = new SurveyRuntimeHelper();
597 try {
598 $tmp->run($surveyid, $redata);
599 } catch (WrongTemplateVersionException $ex) {
600 echo $ex->getMessage();
601 }
602
603 if (App()->request->getPost('saveall')) {
#4
– /var/www/html/limesurvey/application/controllers/survey/index.php(24): index->action()
19 public $oTemplate;
20
21 public function run()
22 {
23 useFirebug();
24 $this->action();
25 }
26
27 public function action()
28 {
29 global $surveyid;
#5
– /var/www/html/limesurvey/framework/web/actions/CAction.php(76): index->run()
71 {
72 $method=new ReflectionMethod($this, 'run');
73 if($method->getNumberOfParameters()>0)
74 return $this->runWithParamsInternal($this, $method, $params);
75
76 $this->run();
77 return true;
78 }
79
80 /**
81 * Executes a method of an object with the supplied named parameters.
#6
– /var/www/html/limesurvey/framework/web/CController.php(308): CAction->runWithParams(array("r" => "survey/index", "sid" => "379325", "newtest" => "Y", "lang" => "pt"))
303 {
304 $priorAction=$this->_action;
305 $this->_action=$action;
306 if($this->beforeAction($action))
307 {
308 if($action->runWithParams($this->getActionParams())===false)
309 $this->invalidActionParams($action);
310 else
311 $this->afterAction($action);
312 }
313 $this->_action=$priorAction;
#7
– /var/www/html/limesurvey/framework/web/CController.php(286): CController->runAction(index)
281 * @see runAction
282 */
283 public function runActionWithFilters($action,$filters)
284 {
285 if(empty($filters))
286 $this->runAction($action);
287 else
288 {
289 $priorAction=$this->_action;
290 $this->_action=$action;
291 CFilterChain::create($this,$action,$filters)->run();
#8
– /var/www/html/limesurvey/framework/web/CController.php(265): CController->runActionWithFilters(index, array())
260 {
261 if(($parent=$this->getModule())===null)
262 $parent=Yii::app();
263 if($parent->beforeControllerAction($this,$action))
264 {
265 $this->runActionWithFilters($action,$this->filters());
266 $parent->afterControllerAction($this,$action);
267 }
268 }
269 else
270 $this->missingAction($actionID);
#9
– /var/www/html/limesurvey/framework/web/CWebApplication.php(282): CController->run("index")
277 {
278 list($controller,$actionID)=$ca;
279 $oldController=$this->_controller;
280 $this->_controller=$controller;
281 $controller->init();
282 $controller->run($actionID);
283 $this->_controller=$oldController;
284 }
285 else
286 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
287 array('{route}'=>$route===''?$this->defaultController:$route)));
#10
– /var/www/html/limesurvey/framework/web/CWebApplication.php(141): CWebApplication->runController("survey/index")
136 foreach(array_splice($this->catchAllRequest,1) as $name=>$value)
137 $_GET[$name]=$value;
138 }
139 else
140 $route=$this->getUrlManager()->parseUrl($this->getRequest());
141 $this->runController($route);
142 }
143
144 /**
145 * Registers the core application components.
146 * This method overrides the parent implementation by registering additional core components.
#11
– /var/www/html/limesurvey/framework/base/CApplication.php(185): CWebApplication->processRequest()
180 public function run()
181 {
182 if($this->hasEventHandler('onBeginRequest'))
183 $this->onBeginRequest(new CEvent($this));
184 register_shutdown_function(array($this,'end'),0,false);
185 $this->processRequest();
186 if($this->hasEventHandler('onEndRequest'))
187 $this->onEndRequest(new CEvent($this));
188 }
189
190 /**
#12
– /var/www/html/limesurvey/index.php(195): CApplication->run()
190 require_once APPPATH . 'core/LSYii_Application' . EXT;
191
192 $config = require_once(APPPATH . 'config/internal' . EXT);
193
194 Yii::$enableIncludePath = false;
195 Yii::createApplication('LSYii_Application', $config)->run();
196
197 /* End of file index.php */
198 /* Location: ./index.php */
2018-01-03 16:11:53 Apache Yii Framework/1.1.18
The topic has been locked.
More
6 years 2 months ago #162167 by jelo
Looks like a bug in the upgrade routine with replacing the template fruity.
You might can fix it if you delete the template and replace it with the templatefiles from the download archive of 3.0.1.

I recommend to open a bugticket.
www.limesurvey.org/community/bug-tracker

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • mferraz
  • mferraz's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 2 months ago #162172 by mferraz
Hi.

Already open it.
I could solve this after change the default theme to vanilla, and making a small change on the code in application/views/admin/survey/surveySummary_view.php:

<a href='<?=$sTemplateEditorUrl?>' title="<?php eT("Open template editor in new window"); ?>" target="_blank" class="btn btn-default btn-xs pull-right"><i class="fa fa-object-group"></i></a>
<?php
} else {
if (isset($templatename))
echo $templatename;
else
echo "";
}
} else {
$errorMessage = sprintf(
gT('Error: Theme "%s" is not installed.'),


Thank you.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose