View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
13120Bug reportsOtherpublic2018-01-10 11:35
ReporterTonisOrmisson Assigned ToLouisGac 
PriorityurgentSeverityminor 
Status closedResolutionfixed 
Product Version3.0.0-rc.x 
Summary13120: Cant change to custom default survey template
Description

Cant change to custom default survey template

Steps To Reproduce

have a custom tempolate in upload/themes/...

go to global settings
change default survey template to your custom template
an error is thrown ....

(btw the theme is not visible on survey theme selection)

Additional Information

Exception

Error: Can't find a manifest for kuddelmuddel_base in ' /var/www/html/themes/survey/kuddelmuddel_base/ '

/var/www/html/application/models/TemplateManifest.php(574)

562 $bOldEntityLoaderState = libxml_disable_entity_loader(true); // @see: http://phpsecurity.readthedocs.io/en/latest/Injection-Attacks.html#xml-external-entity-injection
563 $sXMLConfigFile = file_get_contents(realpath($this->xmlFile)); // @see: Now that entity loader is disabled, we can't use simplexml_load_file; so we must read the file with file_get_contents and convert it as a string
564 $oXMLConfig = simplexml_load_string($sXMLConfigFile);
565
566
567 foreach($oXMLConfig->config->xpath("//file") as $oFileName){
568 $oFileName[0] = get_absolute_path( $oFileName[0]);
569 }
570
571 $this->config = $oXMLConfig; // Using PHP >= 5.4 then no need to decode encode + need attributes : then other function if needed :https://secure.php.net/manual/en/book.simplexml.php#108688 for example
572 libxml_disable_entity_loader($bOldEntityLoaderState); // Put back entity loader to its original state, to avoid contagion to other applications on the server
573 } else {
574 throw new Exception(" Error: Can't find a manifest for $this->sTemplateName in ' $this->path ' ");
575 }
576 }
577
578 /*
579
Set the path of the current template
580 It checks if it's a core or a user template, if it exists, and if it has a config file
581
/
582 private function setPath()
583 {
584 // If the template is standard, its root is based on standardthemerootdir, else, it is a user template, its root is based on userthemerootdir
585 $this->path = ($this->isStandard) ?Yii::app()->getConfig("standardthemerootdir").DIRECTORY_SEPARATOR.$this->sTemplateName.DIRECTORY_SEPARATOR : Yii::app()->getConfig("userthemerootdir").DIRECTORY_SEPARATOR.$this->sTemplateName.DIRECTORY_SEPARATOR;
586

Stack Trace
#0

/var/www/html/application/models/TemplateManifest.php(669): TemplateManifest->readManifest()

664 public function setBasics($sTemplateName = '', $iSurveyId = '')
665 {
666 $this->setTemplateName($sTemplateName, $iSurveyId); // Check and set template name
667 $this->setIsStandard(); // Check if it is a CORE template
668 $this->setPath(); // Check and set path
669 $this->readManifest(); // Check and read the manifest to set local params
670 }
671
672 /*
673
Add a file replacement entry
674 * eg: <filename replace="css/template.css">css/template.css</filename>

#1

/var/www/html/application/models/Template.php(258): TemplateManifest->setBasics("kuddelmuddel_base", null)

253
254
255 // If no row found, or if the template folder for this configuration row doesn't exist we load the XML config (which will load the default XML)
256 if ($bForceXML || !is_a($oTemplateConfigurationModel, 'TemplateConfiguration') || !$oTemplateConfigurationModel->checkTemplate()) {
257 $oTemplateConfigurationModel = new TemplateManifest;
258 $oTemplateConfigurationModel->setBasics($sTemplateName, $iSurveyId);
259
260 }
261
262 //$oTemplateConfigurationModel->prepareTemplateRendering($sTemplateName, $iSurveyId);
263 return $oTemplateConfigurationModel;

#2

/var/www/html/application/models/Template.php(370): Template::getTemplateConfiguration("kuddelmuddel_base", null, null, true)

365 if (!is_file("$sUserTemplateRootDir/$sTemplatePath")
366 && $sTemplatePath != "."
367 && $sTemplatePath != ".." && $sTemplatePath != ".svn"
368 && (file_exists("{$sUserTemplateRootDir}/{$sTemplatePath}/config.xml"))) {
369
370 $oTemplate = self::getTemplateConfiguration($sTemplatePath, null, null, true);
371
372 if (is_object($oTemplate)) {
373 $aTemplateList[$sTemplatePath] = $sUserTemplateRootDir.DIRECTORY_SEPARATOR.$sTemplatePath;
374 }
375 }

#3
+
/var/www/html/application/helpers/common_helper.php(256): Template::getTemplateList()
#4
+
/var/www/html/application/views/admin/global_settings/_general.php(9): getTemplateList()
#5
+
/var/www/html/framework/web/CBaseController.php(126): require("/var/www/html/application/views/admin/global_settings/_general.p...")
#6
+
/var/www/html/framework/web/CBaseController.php(95): CBaseController->renderInternal("/var/www/html/application/views/admin/./global_settings/_general...", array("aListOfThemeObjects" => array("Apple_Blossom" => stdClass, "Bay_of_Many" => stdClass, "Black_Pearl" => stdClass, "Dark_Sky" => stdClass, ...), "aEncodings" => array("auto" => "(Automatic)", "swe7" => "7bit Swedish", "armscii8" => "ARMSCII-8 Armenian", "big5" => "Big5 Traditional Chinese", ...), "thischaracterset" => "auto", "sideMenuBehaviour" => "adaptive"), true)
#7
+
/var/www/html/framework/web/CController.php(872): CBaseController->renderFile("/var/www/html/application/views/admin/./global_settings/_general...", array("aListOfThemeObjects" => array("Apple_Blossom" => stdClass, "Bay_of_Many" => stdClass, "Black_Pearl" => stdClass, "Dark_Sky" => stdClass, ...), "aEncodings" => array("auto" => "(Automatic)", "swe7" => "7bit Swedish", "armscii8" => "ARMSCII-8 Armenian", "big5" => "Big5 Traditional Chinese", ...), "thischaracterset" => "auto", "sideMenuBehaviour" => "adaptive"), true)
#8
+
/var/www/html/application/views/admin/globalSettings_view.php(49): CController->renderPartial("./global_settings/_general", array("aListOfThemeObjects" => array("Apple_Blossom" => stdClass, "Bay_of_Many" => stdClass, "Black_Pearl" => stdClass, "Dark_Sky" => stdClass, ...), "aEncodings" => array("auto" => "(Automatic)", "swe7" => "7bit Swedish", "armscii8" => "ARMSCII-8 Armenian", "big5" => "Big5 Traditional Chinese", ...), "thischaracterset" => "auto", "sideMenuBehaviour" => "adaptive"))
#9
+
/var/www/html/framework/web/CBaseController.php(126): require("/var/www/html/application/views/admin/globalSettings_view.php")
#10
+
/var/www/html/framework/web/CBaseController.php(95): CBaseController->renderInternal("/var/www/html/application/views/admin/globalSettings_view.php", array("title" => "hi", "message" => "message", "usercount" => "0", "surveycount" => "1", ...), true)
#11
+
/var/www/html/framework/web/CController.php(872): CBaseController->renderFile("/var/www/html/application/views/admin/globalSettings_view.php", array("title" => "hi", "message" => "message", "usercount" => "0", "surveycount" => "1", ...), true)
#12
+
/var/www/html/application/core/Survey_Common_Action.php(267): CController->renderPartial("/admin/globalSettings_view", array("title" => "hi", "message" => "message", "usercount" => "0", "surveycount" => "1", ...), true)
#13
+
/var/www/html/application/core/Survey_Common_Action.php(338): Survey_Common_Action->renderCentralContents("", array("globalSettings_view"), array("title" => "hi", "message" => "message", "usercount" => "0", "surveycount" => "1", ...))
#14
+
/var/www/html/application/controllers/admin/globalsettings.php(388): Survey_Common_Action->_renderWrappedTemplate("", "globalSettings_view", array("title" => "hi", "message" => "message", "usercount" => "0", "surveycount" => "1", ...), false)
#15
+
/var/www/html/application/controllers/admin/globalsettings.php(97): GlobalSettings->_renderWrappedTemplate("", "globalSettings_view", array("title" => "hi", "message" => "message", "usercount" => "0", "surveycount" => "1", ...))
#16
+
/var/www/html/application/controllers/admin/globalsettings.php(46): GlobalSettings->_displaySettings()
#17
unknown(0): GlobalSettings->index()
#18
+
/var/www/html/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(GlobalSettings, array())
#19
+
/var/www/html/application/core/Survey_Common_Action.php(83): CAction->runWithParamsInternal(GlobalSettings, ReflectionMethod, array("r" => "admin/globalsettings"))
#20
+
/var/www/html/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("r" => "admin/globalsettings"))
#21
+
/var/www/html/framework/web/CController.php(286): CController->runAction(GlobalSettings)
#22
+
/var/www/html/framework/web/CController.php(265): CController->runActionWithFilters(GlobalSettings, array())
#23
+
/var/www/html/application/controllers/AdminController.php(162): CController->run("globalsettings")
#24
+
/var/www/html/framework/web/CWebApplication.php(282): AdminController->run("globalsettings")
#25
+
/var/www/html/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/globalsettings")
#26
+
/var/www/html/framework/base/CApplication.php(185): CWebApplication->processRequest()
#27
+
/var/www/html/index.php(197): CApplication->run()

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)Version 3.0.1
I will donate to the project if issue is resolvedNo
Browser
Database type & versionna
Server OS (if known)na
Webserver software & version (if known)na
PHP Versionna

Users monitoring this issue

lmad

Activities

TonisOrmisson

TonisOrmisson

2018-01-04 09:53

developer   ~45418

also:
Default theme selection in gemeral settings is listing templates that are not activated for surveys

Haenelt

Haenelt

2018-01-05 11:28

reporter   ~45425

this workaround worked for me:
set a link from themes/survey/my_theme to upload/themes/survey/my_themes

in Linux - in dopcument root directory:
ln -s ../../upload/themes/survey/my_theme themes/survey/my_theme

TonisOrmisson

TonisOrmisson

2018-01-05 11:53

developer   ~45426

This will not fix the bug in LS :|
it might fix it on tha specific installation, but not the bug
Thanks anyway.

LouisGac

LouisGac

2018-01-08 11:28

developer   ~45451

Tonis: could you please upload here your template so I can check if it's valid?

Haenelt

Haenelt

2018-01-08 11:46

reporter   ~45463

A problem may be the entry in DB table 'templates.folder' : 'erweitert_vanilla' . LimeSurvey then actually looks for the template in folder LS/themes/survey/erweitert_vanilla.
That's why my workaround with the link works.
My test theme is an unchanged 'erweitert_vanilla' with stating parent and child theme in config.xml

&lt;metadata>
    &lt;name>erweitert_vanilla&lt;/name>
    &lt;title>Bootstrap Vanilla&lt;/title>

...
<version>3.0</version>
<apiVersion>3</apiVersion>
<description><![CDATA[<strong>LimeSurvey Bootstrap Vanilla Survey Theme</strong><br>A clean and simple base that can be used by developers to create their own Bootstrap based theme.]]></description>
<last_update/>
<extends>vanilla</extends></metadata>

TonisOrmisson

TonisOrmisson

2018-01-08 11:57

developer   ~45467

Louis, the Template:
https://github.com/TonisOrmisson/ls3-theme-km-base

LouisGac

LouisGac

2018-01-08 11:57

developer   ~45468

ok I'll do some testing this afternoon to check if it's a general problem.

TonisOrmisson

TonisOrmisson

2018-01-08 13:46

developer   ~45488

the folder in templates table has no path yes. This is how it looks after pushing the theme->install button:

+-------------------+-------------------+
| name | folder |
+-------------------+-------------------+
| vanilla | vanilla |
| fruity | fruity |
| bootswatch | bootswatch |
| kuddelmuddel_base | kuddelmuddel_base |
+-------------------+-------------------+

LouisGac

LouisGac

2018-01-09 10:30

developer   ~45501

ok so indeed the problem was the name of the template (too long)
I changed it to kmb (name + directory): it works fine.
I'm going to remove that limitation.

LouisGac

LouisGac

2018-01-09 11:10

developer   ~45502

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=25861

LouisGac

LouisGac

2018-01-09 11:11

developer   ~45503

so the problem was the harsh validation of template name removing the dashes

Haenelt

Haenelt

2018-01-09 12:21

reporter   ~45505

Thank you very much for your bug fix.
But unfortunately it does not solve my problem. I still need the link from the parent theme directory to the child theme directory

Debian 8.9

  • created a child theme "erweitert_vanilla" in the dashboard
  • system created LS/upload/themes/survey/erweitert_vanilla
  • installed 'erweitert_vanilla' in the dashboard
  • system created database entry in table 'templates' (folder without path specification)
    +-------------------+-------------------+
    | name | folder |
    +-------------------+-------------------+
    | vanilla | vanilla |
    | fruity | fruity |
    | bootswatch | bootswatch |
    | erweitert_vanilla | erweitert_vanilla |
    +-------------------+-------------------+
  • attempt to set 'erweitert_vanilla' as default designs via dashboard leads to error message

Error: Can't find a manifest for erweitert_vanilla in ' /var/www/html/LS/themes/survey/erweitert_vanilla/ '

i.e.: the system is looking for the child theme in the parent theme directory


this workaround works:

setting a link from themes/survey/erweitert_vanilla to upload/themes/survey/erweitert_vanilla

in Debian - in document root directory:
ln -s ../../upload/themes/survey/erweitert_vanilla themes/survey/erweitert_vanilla

LouisGac

LouisGac

2018-01-09 14:05

developer   ~45512

Haenelt: those steps to reproduce are easier to understand.
I can reproduce the bug.

TonisOrmisson

TonisOrmisson

2018-01-10 08:46

developer   ~45537

Ok, I understand that the name validation has been changed.
But the wrong path still exists. After pulling the custom Theme views ares till looked from LS themes folder. I still get exact same error

Error: Can't find a manifest for .... in LS/themes/ yada yada

LouisGac

LouisGac

2018-01-10 10:03

developer   ~45538

yep I got it. I'll push the fix today

TonisOrmisson

TonisOrmisson

2018-01-10 10:07

developer   ~45539

Excellent, thanks

LouisGac

LouisGac

2018-01-10 10:45

developer   ~45541

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=25895

LouisGac

LouisGac

2018-01-10 10:49

developer   ~45542

should be fixed now

Haenelt

Haenelt

2018-01-10 11:02

reporter   ~45543

Great! Works perfectly now.
Thank you very much

TonisOrmisson

TonisOrmisson

2018-01-10 11:18

developer   ~45544

Thanks, works for me also

Related Changesets

LimeSurvey: master 41dd8d32

2018-01-09 11:10:27

LouisGac

Details Diff
Fixed issue 13120: Cant use dash in template name Affected Issues
13120
mod - application/controllers/admin/surveyadmin.php Diff File

LimeSurvey: master e930664e

2018-01-10 10:45:35

LouisGac

Details Diff
Fixed issue 13120: Cant change to custom default survey template Affected Issues
13120
mod - application/models/Template.php Diff File

Issue History

Date Modified Username Field Change
2018-01-04 08:50 TonisOrmisson New Issue
2018-01-04 09:53 TonisOrmisson Note Added: 45418
2018-01-05 11:28 Haenelt Note Added: 45425
2018-01-05 11:53 TonisOrmisson Note Added: 45426
2018-01-08 11:28 LouisGac Note Added: 45451
2018-01-08 11:28 LouisGac Sticky Issue No => Yes
2018-01-08 11:46 Haenelt Note Added: 45463
2018-01-08 11:57 TonisOrmisson Note Added: 45467
2018-01-08 11:57 LouisGac Note Added: 45468
2018-01-08 12:06 LouisGac Priority none => urgent
2018-01-08 13:46 TonisOrmisson Note Added: 45488
2018-01-08 16:07 lmad Issue Monitored: lmad
2018-01-09 10:30 LouisGac Note Added: 45501
2018-01-09 11:10 LouisGac Changeset attached => LimeSurvey master 41dd8d32
2018-01-09 11:10 LouisGac Note Added: 45502
2018-01-09 11:10 LouisGac Assigned To => LouisGac
2018-01-09 11:10 LouisGac Resolution open => fixed
2018-01-09 11:11 LouisGac Note Added: 45503
2018-01-09 11:58 LouisGac Sticky Issue Yes => No
2018-01-09 11:59 LouisGac Status new => resolved
2018-01-09 12:21 Haenelt Note Added: 45505
2018-01-09 14:05 LouisGac Note Added: 45512
2018-01-10 08:46 TonisOrmisson Note Added: 45537
2018-01-10 10:03 LouisGac Note Added: 45538
2018-01-10 10:07 TonisOrmisson Note Added: 45539
2018-01-10 10:45 LouisGac Changeset attached => LimeSurvey master e930664e
2018-01-10 10:45 LouisGac Note Added: 45541
2018-01-10 10:49 LouisGac Note Added: 45542
2018-01-10 11:02 Haenelt Note Added: 45543
2018-01-10 11:18 TonisOrmisson Note Added: 45544
2018-01-10 11:35 LouisGac Status resolved => closed
2021-08-03 07:32 guest Bug heat 6 => 8