View Issue Details

IDProjectCategoryView StatusLast Update
16245Bug reportsTheme editorpublic2020-06-29 18:55
Reporterebourque Assigned Toeddylackmann  
PriorityhighSeveritycrash 
Status assignedResolutionopen 
Product Version4.2.x 
Summary16245: Extending themes Vanilla and Fruity broken since 4.2.0
Description

Starting with 4.2.0, extending the theme Vanilla or Fruity shows an error in the preview box.

Extending Vanilla shows the error: Calling "tostring" method on a "stdClass" object is not allowed in "string_templateb55aa4d0480829447d1e9202fbd9338e3599742834899f6fdab87be7c4eaab2b" at line 76.
Extending Fruity shows the error: Calling "
tostring" method on a "stdClass" object is not allowed.

Clicking the Theme Options button for those extended themes produce a 500 HTTP error.

Using any of those extended themes in a survey produce a 500 HTTP error when previewing.

Steps To Reproduce

On a clean install of 4.2.x:

  • Extend Vanilla of Fruity theme
  • When redirected on the newly extended theme, check the preview box for an error message.
Additional Information

I'm running my tests with Docker using this image: https://hub.docker.com/r/acspri/limesurvey

TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 4.2.2+200504
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionMariaDB 10.3
Server OS (if known)Debian Buster
Webserver software & version (if known)Apache 2.4.38
PHP Version7.3.17

Relationships

duplicate of 16233 resolvedDenisChenu Receive notice when copying survey theme 
related to 16295 closedollehar Copying Base Themes causes the created themes to crash 

Activities

ollehar

ollehar

2020-05-08 10:03

administrator   ~57624

Can you enable debug = 2 in application/config/config.php and try again, please? Paste the complete error message here.

DenisChenu

DenisChenu

2020-05-08 11:17

developer   ~57628

Duplicate : https://bugs.limesurvey.org/view.php?id=16233#c57566

ebourque

ebourque

2020-05-08 16:08

reporter   ~57634

I see it could be a duplicate but here is some more info if it can be useful.

When setting debug=2 and accessing /admin/themeoptions with extended themes in it, I get the content of Debug_2_themes_page.txt.
When accessing /admin/themeoptions/sa/update/id/6 which in my case is the options of extends-fruity, I get Debug_2_extends_fruity.txt.
When setting debug=1 and accessing /admin/themeoptions, I get the page as usual but with additional notices, see image Debug_1.png
Still with debug=1, when clicking the Theme options button, I get the content of Debug_1.txt.

Debug_1.txt (4,771 bytes)   
Notice: Object of class stdClass could not be converted to int in /var/www/html/application/models/TemplateConfiguration.php on line 1527

Notice: Object of class stdClass could not be converted to int in /var/www/html/application/models/TemplateConfiguration.php on line 1527

Notice: Object of class stdClass could not be converted to int in /var/www/html/application/models/TemplateConfiguration.php on line 1527
Recoverable error
Object of class stdClass could not be converted to string

/var/www/html/application/models/TemplateConfiguration.php(1591)

1579                         gT("Small screens"),
1580                         gT("Off")),
1581                     $value
1582                 );
1583             } else {
1584                 $oOptions[$key] = str_replace(
1585                     array('on', 'off', 'top', 'bottom'),
1586                     array(
1587                         gT("Yes"),
1588                         gT("No"),
1589                         gT("Top"),
1590                         gT("Bottom")),
1591                     $value
1592                 );
1593             }
1594         }
1595         return $oOptions;
1596     }
1597 }
Stack Trace
#0	
–  /var/www/html/application/models/TemplateConfiguration.php(1591): str_replace(array("on", "off", "top", "bottom"), array("Yes", "No", "Top", "Bottom"), stdClass)
1586                     array(
1587                         gT("Yes"),
1588                         gT("No"),
1589                         gT("Top"),
1590                         gT("Bottom")),
1591                     $value
1592                 );
1593             }
1594         }
1595         return $oOptions;
1596     }
#1	
–  /var/www/html/application/models/TemplateConfiguration.php(1021): TemplateConfiguration::translateOptionLabels(array("container" => stdClass, "zebrastriping" => stdClass, "stickymatrixheaders" => stdClass, "greyoutselected" => stdClass, ...))
1016         $oTemplate->setToInherit();
1017         $oTemplate->setOptions();
1018         $oTemplate->setOptionInheritance();
1019 
1020         $oOptions = (array) $oSimpleInheritanceTemplate->oOptions;
1021         $oOptions = TemplateConfiguration::translateOptionLabels($oOptions);
1022 
1023         //We add some extra values to the option page
1024         //This is just a dirty hack, and somewhere in the future we will correct it
1025         $renderArray['oParentOptions'] = array_merge(
1026             ($oOptions),
#2	
+  /var/www/html/framework/base/CComponent.php(111): TemplateConfiguration->getOptionPage()
#3	
+  /var/www/html/framework/db/ar/CActiveRecord.php(145): CComponent->__get("optionPage")
#4	
–  /var/www/html/application/models/TemplateConfiguration.php(1479): CActiveRecord->__get("optionPage")
1474                 // NOTE: this is object recursive (if parent configuration field is set to inherit,
1475                 // then it will lead to this method again.)
1476                 $sAttribute = $this->getParentConfiguration()->$name;
1477             }
1478         } else {
1479             $sAttribute = parent::__get($name);
1480         }
1481 
1482         return $sAttribute;
1483     }
1484 
#5	
+  /var/www/html/application/controllers/admin/themeoptions.php(602): TemplateConfiguration->__get("optionPage")
#6	
+  /var/www/html/application/controllers/admin/themeoptions.php(245): themeoptions->updateCommon(TemplateConfiguration)
#7	
 unknown(0): themeoptions->update("6")
#8	
+  /var/www/html/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(themeoptions, array("6"))
#9	
+  /var/www/html/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal(themeoptions, ReflectionMethod, array("id" => "6", "sa" => "update", "iId" => "6"))
#10	
+  /var/www/html/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("id" => "6", "sa" => "update", "iId" => "6"))
#11	
+  /var/www/html/framework/web/CController.php(286): CController->runAction(themeoptions)
#12	
+  /var/www/html/framework/web/CController.php(265): CController->runActionWithFilters(themeoptions, array())
#13	
+  /var/www/html/application/controllers/AdminController.php(180): CController->run("themeoptions")
#14	
+  /var/www/html/framework/web/CWebApplication.php(282): AdminController->run("themeoptions")
#15	
+  /var/www/html/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/themeoptions/sa/update")
#16	
+  /var/www/html/framework/base/CApplication.php(185): CWebApplication->processRequest()
#17	
+  /var/www/html/index.php(182): CApplication->run()
2020-05-08 13:55:46 Apache/2.4.38 (Debian) Yii Framework/1.1.22-dev
Debug_1.txt (4,771 bytes)   
Debug_1.png (24,850 bytes)   
Debug_1.png (24,850 bytes)   
Debug_2_extends_fruity.txt (4,705 bytes)   
PHP notice
Object of class stdClass could not be converted to int

/var/www/html/application/models/TemplateConfiguration.php(1527)

1515             [':template_name'=>$this->template_name]
1516         );
1517     }
1518 
1519     /**
1520      * Get showpopups value from config or template configuration
1521      */
1522     public function getshowpopups()
1523     {
1524         $config = (int) App()->getConfig('showpopups');
1525         if ($config == 2) {
1526             if (isset($this->oOptions->showpopups)) {
1527                 $this->showpopups = (int)$this->oOptions->showpopups;
1528             } else {
1529                 $this->showpopups = 1;
1530             }
1531         } else {
1532             $this->showpopups = $config;
1533         }
1534     }
1535 
1536     /**
1537      * Set each option key value to 'inherit' instead of having only one 'inherit' value for options.
1538      * Keys are fetched from parent xml configuration.
1539      */
Stack Trace
#0	
–  /var/www/html/application/models/TemplateConfig.php(162): TemplateConfiguration->getshowpopups()
157         $this->setBasics($sTemplateName, $iSurveyId, $bUseMagicInherit);
158         $this->setMotherTemplates(); // Recursive mother templates configuration
159         $this->setThisTemplate(); // Set the main config values of this template
160         $this->createTemplatePackage($this); // Create an asset package ready to be loaded
161         $this->removeFiles();
162         $this->getshowpopups();
163 
164         if (!empty($sTemplateName) && !empty($iSurveyId)) {
165             self::$aPreparedToRender[$sTemplateName][$iSurveyId][$bUseMagicInherit] = $this;
166         }
167         return $this;
#1	
–  /var/www/html/application/models/Template.php(505): TemplateConfig->prepareTemplateRendering("extends_fruity", null)
500             return self::getTemplateConfiguration($sTemplateName, $iSurveyId, $iSurveyGroupId, $bForceXML, true);
501         }
502 
503         if ( empty(self::$instance) || ! self::isCorrectInstance($sTemplateName) ) {
504           self::$instance = self::getTemplateConfiguration($sTemplateName, $iSurveyId, $iSurveyGroupId, $bForceXML);
505           self::$instance->prepareTemplateRendering($sTemplateName, $iSurveyId);
506         }
507 
508         return self::getLastInstance(false);
509     }
510 
#2	
–  /var/www/html/application/controllers/admin/themeoptions.php(591): Template::getInstance("extends_fruity", null, null)
586      * @return void
587      */
588     private function updateCommon(TemplateConfiguration $model, $sid = null, $gsid = null)
589     {
590         /* init the template to current one if option use some twig function (imageSrc for example) mantis #14363 */
591         $oTemplate = Template::model()->getInstance($model->template_name, $sid, $gsid);
592 
593         $oModelWithInheritReplacement = TemplateConfiguration::model()->findByPk($model->id);
594         $aOptionAttributes            = TemplateManifest::getOptionAttributes($oTemplate->path);
595         $aTemplateConfiguration = $oModelWithInheritReplacement->getOptionPageAttributes();
596         App()->clientScript->registerPackage('bootstrap-switch', LSYii_ClientScript::POS_BEGIN);
#3	
+  /var/www/html/application/controllers/admin/themeoptions.php(245): themeoptions->updateCommon(TemplateConfiguration)
#4	
 unknown(0): themeoptions->update("6")
#5	
+  /var/www/html/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(themeoptions, array("6"))
#6	
+  /var/www/html/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal(themeoptions, ReflectionMethod, array("id" => "6", "sa" => "update", "iId" => "6"))
#7	
+  /var/www/html/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("id" => "6", "sa" => "update", "iId" => "6"))
#8	
+  /var/www/html/framework/web/CController.php(286): CController->runAction(themeoptions)
#9	
+  /var/www/html/framework/web/CController.php(265): CController->runActionWithFilters(themeoptions, array())
#10	
+  /var/www/html/application/controllers/AdminController.php(180): CController->run("themeoptions")
#11	
+  /var/www/html/framework/web/CWebApplication.php(282): AdminController->run("themeoptions")
#12	
+  /var/www/html/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/themeoptions/sa/update")
#13	
+  /var/www/html/framework/base/CApplication.php(185): CWebApplication->processRequest()
#14	
+  /var/www/html/index.php(182): CApplication->run()
2020-05-08 14:02:26 Apache/2.4.38 (Debian) Yii Framework/1.1.22-dev
Debug_2_extends_fruity.txt (4,705 bytes)   
Debug_2_themes_page.txt (9,587 bytes)   
PHP notice
Object of class stdClass could not be converted to int

/var/www/html/application/models/TemplateConfiguration.php(1527)

1515             [':template_name'=>$this->template_name]
1516         );
1517     }
1518 
1519     /**
1520      * Get showpopups value from config or template configuration
1521      */
1522     public function getshowpopups()
1523     {
1524         $config = (int) App()->getConfig('showpopups');
1525         if ($config == 2) {
1526             if (isset($this->oOptions->showpopups)) {
1527                 $this->showpopups = (int)$this->oOptions->showpopups;
1528             } else {
1529                 $this->showpopups = 1;
1530             }
1531         } else {
1532             $this->showpopups = $config;
1533         }
1534     }
1535 
1536     /**
1537      * Set each option key value to 'inherit' instead of having only one 'inherit' value for options.
1538      * Keys are fetched from parent xml configuration.
1539      */
Stack Trace
#0	
–  /var/www/html/application/models/TemplateConfig.php(162): TemplateConfiguration->getshowpopups()
157         $this->setBasics($sTemplateName, $iSurveyId, $bUseMagicInherit);
158         $this->setMotherTemplates(); // Recursive mother templates configuration
159         $this->setThisTemplate(); // Set the main config values of this template
160         $this->createTemplatePackage($this); // Create an asset package ready to be loaded
161         $this->removeFiles();
162         $this->getshowpopups();
163 
164         if (!empty($sTemplateName) && !empty($iSurveyId)) {
165             self::$aPreparedToRender[$sTemplateName][$iSurveyId][$bUseMagicInherit] = $this;
166         }
167         return $this;
#1	
–  /var/www/html/application/models/TemplateConfiguration.php(824): TemplateConfig->prepareTemplateRendering("extends_bootswatch")
819      * @throws Exception
820      */
821     public function getHasOptionPage()
822     {
823         $filteredName = Template::templateNameFilter($this->template->name);
824         $oRTemplate = $this->prepareTemplateRendering($filteredName);
825 
826         $sOptionFile = 'options'.DIRECTORY_SEPARATOR.'options.twig';
827         while (!file_exists($oRTemplate->path.$sOptionFile)) {
828             $oMotherTemplate = $oRTemplate->oMotherTemplate;
829             if (!($oMotherTemplate instanceof TemplateConfiguration)) {
#2	
+  /var/www/html/framework/base/CComponent.php(111): TemplateConfiguration->getHasOptionPage()
#3	
+  /var/www/html/framework/db/ar/CActiveRecord.php(145): CComponent->__get("hasOptionPage")
#4	
–  /var/www/html/application/models/TemplateConfiguration.php(1479): CActiveRecord->__get("hasOptionPage")
1474                 // NOTE: this is object recursive (if parent configuration field is set to inherit,
1475                 // then it will lead to this method again.)
1476                 $sAttribute = $this->getParentConfiguration()->$name;
1477             }
1478         } else {
1479             $sAttribute = parent::__get($name);
1480         }
1481 
1482         return $sAttribute;
1483     }
1484 
#5	
+  /var/www/html/application/models/TemplateConfiguration.php(735): TemplateConfiguration->__get("hasOptionPage")
#6	
+  /var/www/html/framework/base/CComponent.php(111): TemplateConfiguration->getButtons()
#7	
+  /var/www/html/framework/db/ar/CActiveRecord.php(145): CComponent->__get("buttons")
#8	
+  /var/www/html/application/models/TemplateConfiguration.php(1479): CActiveRecord->__get("buttons")
#9	
 /var/www/html/framework/base/CComponent.php(614) : eval()'d code(1): TemplateConfiguration->__get("buttons")
#10	
+  /var/www/html/framework/base/CComponent.php(614): eval()
#11	
+  /var/www/html/framework/zii/widgets/grid/CDataColumn.php(142): CComponent->evaluateExpression("$data->buttons", array("data" => TemplateConfiguration, "row" => 1))
#12	
+  /var/www/html/framework/zii/widgets/grid/CGridColumn.php(231): CDataColumn->getDataCellContent(1)
#13	
+  /var/www/html/framework/zii/widgets/grid/CGridColumn.php(154): CGridColumn->renderDataCellContent(1, TemplateConfiguration)
#14	
+  /var/www/html/framework/zii/widgets/grid/CGridView.php(639): CGridColumn->renderDataCell(1)
#15	
+  /var/www/html/framework/zii/widgets/grid/CGridView.php(623): CGridView->renderDataCell(TbDataColumn, 1)
#16	
+  /var/www/html/framework/zii/widgets/grid/CGridView.php(579): CGridView->renderTableRow(1)
#17	
+  /var/www/html/framework/zii/widgets/grid/CGridView.php(489): CGridView->renderTableBody()
#18	
+  /var/www/html/framework/zii/widgets/CBaseListView.php(181): CGridView->renderItems()
#19	
 unknown(0): CBaseListView->renderSection(array("{items}", "items"))
#20	
+  /var/www/html/framework/zii/widgets/CBaseListView.php(164): preg_replace_callback("/{(\w+)}/", array(TbGridView, "renderSection"), "{items} <div class="row-fluid"><div class="span6">{pager}</div><...")
#21	
+  /var/www/html/framework/zii/widgets/CBaseListView.php(149): CBaseListView->renderContent()
#22	
+  /var/www/html/framework/web/CBaseController.php(182): CBaseListView->run()
#23	
+  /var/www/html/application/views/admin/themeoptions/surveythemelist.php(88): CBaseController->widget("bootstrap.widgets.TbGridView", array("dataProvider" => CActiveDataProvider, "filter" => TemplateConfiguration, "id" => "themeoptions-grid", "summaryText" => "Displaying {start}-{end} of {count} result(s). <div class="col-s...", ...))
#24	
+  /var/www/html/framework/web/CBaseController.php(126): require("/var/www/html/application/views/admin/themeoptions/surveythemeli...")
#25	
+  /var/www/html/framework/web/CBaseController.php(95): CBaseController->renderInternal("/var/www/html/application/views/admin/themeoptions/surveythemeli...", array("oSurveyTheme" => TemplateConfiguration, "pageSize" => 10), true)
#26	
+  /var/www/html/framework/web/CController.php(872): CBaseController->renderFile("/var/www/html/application/views/admin/themeoptions/surveythemeli...", array("oSurveyTheme" => TemplateConfiguration, "pageSize" => 10), true)
#27	
+  /var/www/html/application/controllers/AdminController.php(240): CController->renderPartial("themeoptions/surveythemelist", array("oSurveyTheme" => TemplateConfiguration, "pageSize" => 10), false, false)
#28	
+  /var/www/html/application/views/admin/themeoptions/index.php(39): AdminController->renderPartial("themeoptions/surveythemelist", array("oSurveyTheme" => TemplateConfiguration, "pageSize" => 10))
#29	
+  /var/www/html/framework/web/CBaseController.php(126): require("/var/www/html/application/views/admin/themeoptions/index.php")
#30	
+  /var/www/html/framework/web/CBaseController.php(95): CBaseController->renderInternal("/var/www/html/application/views/admin/themeoptions/index.php", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...), true)
#31	
+  /var/www/html/framework/web/CController.php(872): CBaseController->renderFile("/var/www/html/application/views/admin/themeoptions/index.php", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...), true)
#32	
+  /var/www/html/application/controllers/AdminController.php(240): CController->renderPartial("/admin/themeoptions/index", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...), true, false)
#33	
+  /var/www/html/application/core/Survey_Common_Action.php(274): AdminController->renderPartial("/admin/themeoptions/index", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...), true)
#34	
+  /var/www/html/application/core/Survey_Common_Action.php(357): Survey_Common_Action->renderCentralContents("themeoptions", array("index"), array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...))
#35	
+  /var/www/html/application/controllers/admin/themeoptions.php(425): Survey_Common_Action->_renderWrappedTemplate("themeoptions", "index", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...))
#36	
 unknown(0): themeoptions->index()
#37	
+  /var/www/html/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(themeoptions, array())
#38	
+  /var/www/html/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal(themeoptions, ReflectionMethod, array())
#39	
+  /var/www/html/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array())
#40	
+  /var/www/html/framework/web/CController.php(286): CController->runAction(themeoptions)
#41	
+  /var/www/html/framework/web/CController.php(265): CController->runActionWithFilters(themeoptions, array())
#42	
+  /var/www/html/application/controllers/AdminController.php(180): CController->run("themeoptions")
#43	
+  /var/www/html/framework/web/CWebApplication.php(282): AdminController->run("themeoptions")
#44	
+  /var/www/html/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/themeoptions")
#45	
+  /var/www/html/framework/base/CApplication.php(185): CWebApplication->processRequest()
#46	
+  /var/www/html/index.php(182): CApplication->run()
2020-05-08 13:53:20 Apache/2.4.38 (Debian) Yii Framework/1.1.22-dev
Debug_2_themes_page.txt (9,587 bytes)   
DenisChenu

DenisChenu

2020-05-08 17:36

developer   ~57638

I see it could be a duplicate but here is some more info if it can be useful.

Always usefull !! Thanks :)

Seem confirm is a duplicate, except than i can do nothing on my part ?

GuernseyResearch

GuernseyResearch

2020-05-29 14:50

reporter   ~58096

This has become urgent as we cannot extend the core theme to add our logo and therefore cannot do surveys on version 4.

ollehar

ollehar

2020-05-29 15:25

administrator   ~58097

Can't really reproduce on my local, using latest master.

ebourque

ebourque

2020-05-29 15:36

reporter   ~58098

I reported this issue on 4.2.2 and I reproduced it in 4.2.0 and 4.2.1. I'm pretty sure it was still there in 4.2.3.

However, I just tested in 4.2.4 and I can successfully extend a theme now, even though I didn't read something about a fix it in the changelogs. I suppose it has been fixed on the latest version.

GuernseyResearch

GuernseyResearch

2020-05-29 15:51

reporter   ~58099

The problem still exists on a fresh install of Version 4.2.5+200526

DenisChenu

DenisChenu

2020-05-29 16:47

developer   ~58102

@GuernseyResearch can you reset all of your theme ? Starting by vanilla ?

GuernseyResearch

GuernseyResearch

2020-05-29 16:58

reporter   ~58103

I had started from a fresh load on an empty database and could not extend properly. It gave the error and trying to run the survey just gave a blank screen.
I am clearing the database and files and will do another fresh load and try again.

GuernseyResearch

GuernseyResearch

2020-05-29 19:23

reporter   ~58106

New download, empty database, installed. Theme - vanilla, reset, extend - error as seen in attached

cannot extend the theme.

error.jpg (159,194 bytes)
DenisChenu

DenisChenu

2020-05-29 19:33

developer   ~58107

With same DB and page : can you ativate debug mode at 2 ?

Seems really same issue than : https://bugs.limesurvey.org/view.php?id=16233

It meens a random issue … then … awfull …

GuernseyResearch

GuernseyResearch

2020-05-30 01:32

reporter   ~58110

Activate debug 2
load LS to main menu
Select Configuation / themes
Screen display as attached

call themes.txt (12,139 bytes)   
PHP notice

Object of class stdClass could not be converted to int

/usr/home/chrislt/public_html/guernseyresearch.com/survey/application/models/TemplateConfiguration.php(1527)

1515             [':template_name'=>$this->template_name]
1516         );
1517     }
1518 
1519     /**
1520      * Get showpopups value from config or template configuration
1521      */
1522     public function getshowpopups()
1523     {
1524         $config = (int) App()->getConfig('showpopups');
1525         if ($config == 2) {
1526             if (isset($this->oOptions->showpopups)) {
1527                 $this->showpopups = (int)$this->oOptions->showpopups;
1528             } else {
1529                 $this->showpopups = 1;
1530             }
1531         } else {
1532             $this->showpopups = $config;
1533         }
1534     }
1535 
1536     /**
1537      * Set each option key value to 'inherit' instead of having only one 'inherit' value for options.
1538      * Keys are fetched from parent xml configuration.
1539      */

Stack Trace
#0 	
–
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/models/TemplateConfig.php(162): TemplateConfiguration->getshowpopups()

157         $this->setBasics($sTemplateName, $iSurveyId, $bUseMagicInherit);
158         $this->setMotherTemplates(); // Recursive mother templates configuration
159         $this->setThisTemplate(); // Set the main config values of this template
160         $this->createTemplatePackage($this); // Create an asset package ready to be loaded
161         $this->removeFiles();
162         $this->getshowpopups();
163 
164         if (!empty($sTemplateName) && !empty($iSurveyId)) {
165             self::$aPreparedToRender[$sTemplateName][$iSurveyId][$bUseMagicInherit] = $this;
166         }
167         return $this;

#1 	
–
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/models/TemplateConfiguration.php(1158): TemplateConfig->prepareTemplateRendering("vanilla", null)

1153     {
1154         if (!empty($this->template->extends)) {
1155             $sMotherTemplateName   = $this->template->extends;
1156             $instance = TemplateConfiguration::getInstanceFromTemplateName($sMotherTemplateName);
1157             $instance->template->checkTemplate();
1158             $this->oMotherTemplate = $instance->prepareTemplateRendering($sMotherTemplateName, null);
1159         }
1160     }
1161 
1162     /**
1163      * @todo document me

#2 	
–
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/models/TemplateConfig.php(158): TemplateConfiguration->setMotherTemplates()

153                 self::$aPreparedToRender[$sTemplateName][$iSurveyId][$bUseMagicInherit] = array();
154             }
155         }
156 
157         $this->setBasics($sTemplateName, $iSurveyId, $bUseMagicInherit);
158         $this->setMotherTemplates(); // Recursive mother templates configuration
159         $this->setThisTemplate(); // Set the main config values of this template
160         $this->createTemplatePackage($this); // Create an asset package ready to be loaded
161         $this->removeFiles();
162         $this->getshowpopups();
163 

#3 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/models/TemplateConfiguration.php(824): TemplateConfig->prepareTemplateRendering("4GR")
#4 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/base/CComponent.php(111): TemplateConfiguration->getHasOptionPage()
#5 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/db/ar/CActiveRecord.php(145): CComponent->__get("hasOptionPage")
#6 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/models/TemplateConfiguration.php(1479): CActiveRecord->__get("hasOptionPage")
#7 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/models/TemplateConfiguration.php(735): TemplateConfiguration->__get("hasOptionPage")
#8 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/base/CComponent.php(111): TemplateConfiguration->getButtons()
#9 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/db/ar/CActiveRecord.php(145): CComponent->__get("buttons")
#10 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/models/TemplateConfiguration.php(1479): CActiveRecord->__get("buttons")
#11 	
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/base/CComponent.php(614) : eval()'d code(1): TemplateConfiguration->__get("buttons")
#12 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/base/CComponent.php(614): eval()
#13 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/grid/CDataColumn.php(142): CComponent->evaluateExpression("$data->buttons", array("data" => TemplateConfiguration, "row" => 0))
#14 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/grid/CGridColumn.php(231): CDataColumn->getDataCellContent(0)
#15 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/grid/CGridColumn.php(154): CGridColumn->renderDataCellContent(0, TemplateConfiguration)
#16 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/grid/CGridView.php(639): CGridColumn->renderDataCell(0)
#17 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/grid/CGridView.php(623): CGridView->renderDataCell(TbDataColumn, 0)
#18 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/grid/CGridView.php(579): CGridView->renderTableRow(0)
#19 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/grid/CGridView.php(489): CGridView->renderTableBody()
#20 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/CBaseListView.php(181): CGridView->renderItems()
#21 	
 unknown(0): CBaseListView->renderSection(array("{items}", "items"))
#22 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/CBaseListView.php(164): preg_replace_callback("/{(\w+)}/", array(TbGridView, "renderSection"), "{items} <div class="row-fluid"><div class="span6">{pager}</div><...")
#23 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/zii/widgets/CBaseListView.php(149): CBaseListView->renderContent()
#24 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CBaseController.php(182): CBaseListView->run()
#25 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/views/admin/themeoptions/surveythemelist.php(88): CBaseController->widget("bootstrap.widgets.TbGridView", array("dataProvider" => CActiveDataProvider, "filter" => TemplateConfiguration, "id" => "themeoptions-grid", "summaryText" => "Displaying {start}-{end} of {count} result(s). <div class="col-s...", ...))
#26 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CBaseController.php(126): require("/usr/home/chrislt/public_html/guernseyresearch.com/survey/applic...")
#27 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CBaseController.php(95): CBaseController->renderInternal("/usr/home/chrislt/public_html/guernseyresearch.com/survey/applic...", array("oSurveyTheme" => TemplateConfiguration, "pageSize" => 10), true)
#28 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CController.php(872): CBaseController->renderFile("/usr/home/chrislt/public_html/guernseyresearch.com/survey/applic...", array("oSurveyTheme" => TemplateConfiguration, "pageSize" => 10), true)
#29 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/controllers/AdminController.php(240): CController->renderPartial("themeoptions/surveythemelist", array("oSurveyTheme" => TemplateConfiguration, "pageSize" => 10), false, false)
#30 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/views/admin/themeoptions/index.php(39): AdminController->renderPartial("themeoptions/surveythemelist", array("oSurveyTheme" => TemplateConfiguration, "pageSize" => 10))
#31 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CBaseController.php(126): require("/usr/home/chrislt/public_html/guernseyresearch.com/survey/applic...")
#32 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CBaseController.php(95): CBaseController->renderInternal("/usr/home/chrislt/public_html/guernseyresearch.com/survey/applic...", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...), true)

#33 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CController.php(872): CBaseController->renderFile("/usr/home/chrislt/public_html/guernseyresearch.com/survey/applic...", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...), true)
#34 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/controllers/AdminController.php(240): CController->renderPartial("/admin/themeoptions/index", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...), true, false)
#35 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/core/Survey_Common_Action.php(274): AdminController->renderPartial("/admin/themeoptions/index", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...), true)
#36 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/core/Survey_Common_Action.php(357): Survey_Common_Action->renderCentralContents("themeoptions", array("index"), array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...))
#37 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/controllers/admin/themeoptions.php(425): Survey_Common_Action->_renderWrappedTemplate("themeoptions", "index", array("oAdminTheme" => AdminTheme, "oQuestionTheme" => QuestionTheme, "oSurveyTheme" => TemplateConfiguration, "canImport" => true, ...))
#38 	
 unknown(0): themeoptions->index()
#39 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(themeoptions, array())
#40 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal(themeoptions, ReflectionMethod, array())
#41 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array())
#42 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CController.php(286): CController->runAction(themeoptions)
#43 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CController.php(265): CController->runActionWithFilters(themeoptions, array())
#44 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/application/controllers/AdminController.php(180): CController->run("themeoptions")
#45 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CWebApplication.php(282): AdminController->run("themeoptions")
#46 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/themeoptions")
#47 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/framework/base/CApplication.php(185): CWebApplication->processRequest()
#48 	
+
 /usr/home/chrislt/public_html/guernseyresearch.com/survey/index.php(182): CApplication->run()
2020-05-29 23:26:33 Apache Yii Framework/1.1.22-dev 


call themes.txt (12,139 bytes)   
DenisChenu

DenisChenu

2020-05-30 11:36

developer   ~58116

OK : still exactly the same issue : options of theme are Class, not string or int at this time
https://bugs.limesurvey.org/view.php?id=16233#c57564

Then : this can happen … how it can ? I try to reproduce it again and send the SQL file of the database if i have it.

GuernseyResearch

GuernseyResearch

2020-05-30 17:00

reporter   ~58118

Let me know if there is anything else you want me to try.

GuernseyResearch

GuernseyResearch

2020-06-03 00:40

reporter   ~58148

What is the chance of this being fixed by June 15?

zlobocki

zlobocki

2020-06-04 10:16

reporter   ~58168

I solved this issue with my system by reverting to PHP 7.2

Description:

I had just set up a new instance of limesurvey, but had another old one on a separate server with the same hosting provider.

I noticed that, in the new instance, extending a theme causes a total malfunction of the new extended theme as described above. Some of the symptoms:

  • 500 error when trying to enter theme options for the extended theme; "Object of class stdClass could not be converted to string" is the error message
  • error when trying to preview a survey with the extended theme set

Because it was working fine for the old instance, and it was the same hosting, I tried to solve the issue by looking for differences. Reverting the malfunctioning insance to LimeSurvey 4.1.0 (the version of the first instance) did not fix the bug (!)

I then looked at all the other settings and noticed that the malfunctioning server was using PHP 7.4 while the old server was using 7.2. I changed PHP settings, and while the problem was still popping up in extended themes previously created under PHP 7.4, it was solved for extended themes created with PHP version 7.2.

So database type is MySQL, PHP 7.4 causes malfunction while PHP 7.2 does not, the server meets all the requirements and recommendations for hosting LS. Presumably, the malfunction consists of an incorrect class being assigned to something when creating an extended theme. If I can provide any more data, please let me know specifically what is needed.

GuernseyResearch

GuernseyResearch

2020-06-04 15:53

reporter   ~58181

We are at PHP 7.3.17 expeeriencing the problem.

GuernseyResearch

GuernseyResearch

2020-06-17 18:44

reporter   ~58327

Is there are suggested work around to this problem until the bug is fixed? Moving back to a previous PHP version is not possible. Could we install a (much) older version of LS4, create the theme, and then update? If so, where can I get a pre-4.2 download?

equipc

equipc

2020-06-18 19:14

reporter   ~58343

As I have the same issue with PHP 7.4 on last LS version (4.3), I started to check what's wrong ...

It looks like that when we duplicate a theme, the theme "option" in the DB table "template_configuration" is not correctly copied ...

DenisChenu

DenisChenu

2020-06-19 08:20

developer   ~58345

It looks like that when we duplicate a theme, the theme "option" in the DB table "template_configuration" is not correctly copied ...

My opinion : options can be empty or invalid : LimeSurvey must fix it transparently.

GuernseyResearch

GuernseyResearch

2020-06-29 18:55

reporter   ~58563

Additional information on this problem.

I did a fresh install of Version 4.3.2+200629 to a different server running an older version of PHP (7.0.2). I was able to correctly extend and modify my theme and everything appeared to be working fine.
I then did an EXPORT of that working theme as a zip to my local drive.
Now back to the production server which was updated to Version 4.3.2+200629 and running PHP 7.3.18
I was able to correctly IMPORT the theme and it appears to work fine. I was also able to use the theme editor correctly.
Therefore the problem is in the "theme EXTEND" code.

Issue History

Date Modified Username Field Change
2020-05-08 03:08 ebourque New Issue
2020-05-08 10:03 ollehar Priority none => high
2020-05-08 10:03 ollehar Severity partial_block => crash
2020-05-08 10:03 ollehar Note Added: 57624
2020-05-08 11:17 DenisChenu Relationship added duplicate of 16233
2020-05-08 11:17 DenisChenu Note Added: 57628
2020-05-08 16:08 ebourque Note Added: 57634
2020-05-08 16:08 ebourque File Added: Debug_1.txt
2020-05-08 16:08 ebourque File Added: Debug_1.png
2020-05-08 16:08 ebourque File Added: Debug_2_extends_fruity.txt
2020-05-08 16:08 ebourque File Added: Debug_2_themes_page.txt
2020-05-08 17:36 DenisChenu Note Added: 57638
2020-05-19 09:01 DenisChenu Relationship added related to 16295
2020-05-29 14:50 GuernseyResearch Note Added: 58096
2020-05-29 15:25 ollehar Note Added: 58097
2020-05-29 15:36 ebourque Note Added: 58098
2020-05-29 15:51 GuernseyResearch Note Added: 58099
2020-05-29 16:47 DenisChenu Note Added: 58102
2020-05-29 16:58 GuernseyResearch Note Added: 58103
2020-05-29 19:23 GuernseyResearch Note Added: 58106
2020-05-29 19:23 GuernseyResearch File Added: error.jpg
2020-05-29 19:33 DenisChenu Note Added: 58107
2020-05-30 01:32 GuernseyResearch Note Added: 58110
2020-05-30 01:32 GuernseyResearch File Added: call themes.txt
2020-05-30 11:36 DenisChenu Note Added: 58116
2020-05-30 11:36 DenisChenu File Added: Capture d’écran du 2020-05-30 11-34-30.png
2020-05-30 17:00 GuernseyResearch Note Added: 58118
2020-06-03 00:40 GuernseyResearch Note Added: 58148
2020-06-04 10:16 zlobocki Note Added: 58168
2020-06-04 15:53 GuernseyResearch Note Added: 58181
2020-06-17 18:44 GuernseyResearch Note Added: 58327
2020-06-18 19:14 equipc Note Added: 58343
2020-06-18 19:14 equipc File Added: Capture d’écran 2020-06-18 à 19.11.05.png
2020-06-18 19:14 equipc File Added: Capture d’écran 2020-06-18 à 19.10.32.png
2020-06-19 08:20 DenisChenu Note Added: 58345
2020-06-22 18:49 cdorin Assigned To => eddylackmann
2020-06-22 18:49 cdorin Status new => assigned
2020-06-29 18:55 GuernseyResearch Note Added: 58563