adamzammit / limesurvey-docker

Production ready dockerised Limesurvey
GNU General Public License v3.0
82 stars 51 forks source link

Impossible to export structure lss survey #43

Closed Hooteo closed 1 year ago

Hooteo commented 1 year ago

Hi all, I migrated limesurvey from local to docker (being much more handy). From the initial server I exported the structures and imported them into the new configuration in docker. Unfortunately now I have already published it and it is accessible from outside for clients. I am in trouble in that if I need to export the structure in the future it goes to error. When I do the export of the lss file it returns the following string:

{"success":false,"message":"XMLWriter::writeElement(): Argument #2 ($content) must be of type ?string, stdClass given","error":{"code":500,"type":"TypeError","errorCode":0,"message":"XMLWriter::writeElement(): Argument #2 ($content) must be of type ?string, stdClass given","file":"\/var\/www\/html\/application\/helpers\/export_helper.php","line":3138,"trace":"#0 \/var\/www\/html\/application\/helpers\/export_helper.php(3138): XMLWriter->writeElement('cssframework', Object(stdClass))\n#1 \/var\/www\/html\/application\/helpers\/export_helper.php(3127): writeXmlFromArray(Object(XMLWriter), Array, 'options')\n#2 \/var\/www\/html\/application\/helpers\/export_helper.php(3127): writeXmlFromArray(Object(XMLWriter), Array, 'config')\n#3 \/var\/www\/html\/application\/helpers\/export_helper.php(3125): writeXmlFromArray(Object(XMLWriter), Array, 'theme')\n#4 \/var\/www\/html\/application\/helpers\/export_helper.php(3127): writeXmlFromArray(Object(XMLWriter), Array, 'theme')\n#5 \/var\/www\/html\/application\/helpers\/export_helper.php(3127): writeXmlFromArray(Object(XMLWriter), Array, 'themes_inherite...')\n#6 \/var\/www\/html\/application\/helpers\/export_helper.php(3173): writeXmlFromArray(Object(XMLWriter), Array)\n#7 \/var\/www\/html\/application\/helpers\/export_helper.php(1015): surveyGetThemeConfiguration(421816, Object(XMLWriter), true, 'themes_inherite...')\n#8 \/var\/www\/html\/application\/controllers\/admin\/Export.php(1033): surveyGetXMLData(421816)\n#9 \/var\/www\/html\/application\/controllers\/admin\/Export.php(925): Export->exportMultipleSurveys('[\"421816\"]', 'structure')\n#10 [internal function]: Export->exportMultipleStructureSurveys()\n#11 \/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/actions\/CAction.php(115): ReflectionMethod->invokeArgs(Object(Export), Array)\n#12 \/var\/www\/html\/application\/core\/SurveyCommonAction.php(83): CAction->runWithParamsInternal(Object(Export), Object(ReflectionMethod), Array)\n#13 \/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CController.php(308): SurveyCommonAction->runWithParams(Array)\n#14 \/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CController.php(286): CController->runAction(Object(Export))\n#15 \/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CController.php(265): CController->runActionWithFilters(Object(Export), Array)\n#16 \/var\/www\/html\/application\/controllers\/AdminController.php(202): CController->run('export')\n#17 \/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CWebApplication.php(282): AdminController->run('export')\n#18 \/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CWebApplication.php(141): CWebApplication->runController('admin\/export\/sa...')\n#19 \/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/base\/CApplication.php(185): CWebApplication->processRequest()\n#20 \/var\/www\/html\/index.php(161): CApplication->run()\n#21 {main}","traces":[{"file":"\/var\/www\/html\/application\/helpers\/export_helper.php","line":3138,"function":"writeElement","class":"XMLWriter","type":"->","args":["cssframework",{"@attributes":{"type":"dropdown","category":"Simple options","title":"Variations","parent":"cssframework"}}]},{"file":"\/var\/www\/html\/application\/helpers\/export_helper.php","line":3127,"function":"writeXmlFromArray","args":[{},{"container":"on","showpopups":"1","showclearall":"off","questionhelptextposition":"top","fixnumauto":"off","brandlogo":"on","brandlogofile":"image::theme::files\/logo.png","hideprivacyinfo":"off","cssframework":{"@attributes":{"type":"dropdown","category":"Simple options","title":"Variations","parent":"cssframework"}}},"options"]},{"file":"\/var\/www\/html\/application\/helpers\/export_helper.php","line":3127,"function":"writeXmlFromArray","args":[{},{"options":{"container":"on","showpopups":"1","showclearall":"off","questionhelptextposition":"top","fixnumauto":"off","brandlogo":"on","brandlogofile":"image::theme::files\/logo.png","hideprivacyinfo":"off","cssframework":{"@attributes":{"type":"dropdown","category":"Simple options","title":"Variations","parent":"cssframework"}}}},"config"]},{"file":"\/var\/www\/html\/application\/helpers\/export_helper.php","line":3125,"function":"writeXmlFromArray","args":[{},{"id":null,"sid":421816,"template_name":"Infonet_GDPR","config":{"options":{"container":"on","showpopups":"1","showclearall":"off","questionhelptextposition":"top","fixnumauto":"off","brandlogo":"on","brandlogofile":"image::theme::files\/logo.png","hideprivacyinfo":"off","cssframework":{"@attributes":{"type":"dropdown","category":"Simple options","title":"Variations","parent":"cssframework"}}}}},"theme"]},{"file":"\/var\/www\/html\/application\/helpers\/export_helper.php","line":3127,"function":"writeXmlFromArray","args":[{},[{"id":null,"sid":421816,"template_name":"Infonet_GDPR","config":{"options":{"container":"on","showpopups":"1","showclearall":"off","questionhelptextposition":"top","fixnumauto":"off","brandlogo":"on","brandlogofile":"image::theme::files\/logo.png","hideprivacyinfo":"off","cssframework":{"@attributes":{"type":"dropdown","category":"Simple options","title":"Variations","parent":"cssframework"}}}}}],"theme"]},{"file":"\/var\/www\/html\/application\/helpers\/export_helper.php","line":3127,"function":"writeXmlFromArray","args":[{},{"theme":[{"id":null,"sid":421816,"template_name":"Infonet_GDPR","config":{"options":{"container":"on","showpopups":"1","showclearall":"off","questionhelptextposition":"top","fixnumauto":"off","brandlogo":"on","brandlogofile":"image::theme::files\/logo.png","hideprivacyinfo":"off","cssframework":{"@attributes":{"type":"dropdown","category":"Simple options","title":"Variations","parent":"cssframework"}}}}}]},"themes_inherited"]},{"file":"\/var\/www\/html\/application\/helpers\/export_helper.php","line":3173,"function":"writeXmlFromArray","args":[{},{"themes_inherited":{"theme":[{"id":null,"sid":421816,"template_name":"Infonet_GDPR","config":{"options":{"container":"on","showpopups":"1","showclearall":"off","questionhelptextposition":"top","fixnumauto":"off","brandlogo":"on","brandlogofile":"image::theme::files\/logo.png","hideprivacyinfo":"off","cssframework":{"@attributes":{"type":"dropdown","category":"Simple options","title":"Variations","parent":"cssframework"}}}}}]}}]},{"file":"\/var\/www\/html\/application\/helpers\/export_helper.php","line":1015,"function":"surveyGetThemeConfiguration","args":[421816,{},true,"themes_inherited"]},{"file":"\/var\/www\/html\/application\/controllers\/admin\/Export.php","line":1033,"function":"surveyGetXMLData","args":[421816]},{"file":"\/var\/www\/html\/application\/controllers\/admin\/Export.php","line":925,"function":"exportMultipleSurveys","class":"Export","type":"->","args":["[\"421816\"]","structure"]},{"function":"exportMultipleStructureSurveys","class":"Export","type":"->","args":[],"file":"unknown","line":0},{"file":"\/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/actions\/CAction.php","line":115,"function":"invokeArgs","class":"ReflectionMethod","type":"->","args":[{},[]]},{"file":"\/var\/www\/html\/application\/core\/SurveyCommonAction.php","line":83,"function":"runWithParamsInternal","class":"CAction","type":"->","args":[{},{"name":"exportMultipleStructureSurveys","class":"Export"},{"sa":"exportMultipleStructureSurveys"}]},{"file":"\/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CController.php","line":308,"function":"runWithParams","class":"SurveyCommonAction","type":"->","args":[{"sa":"exportMultipleStructureSurveys"}]},{"file":"\/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CController.php","line":286,"function":"runAction","class":"CController","type":"->","args":[{}]},{"file":"\/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CController.php","line":265,"function":"runActionWithFilters","class":"CController","type":"->","args":[{},[]]},{"file":"\/var\/www\/html\/application\/controllers\/AdminController.php","line":202,"function":"run","class":"CController","type":"->","args":["export"]},{"file":"\/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CWebApplication.php","line":282,"function":"run","class":"AdminController","type":"->","args":["export"]},{"file":"\/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/web\/CWebApplication.php","line":141,"function":"runController","class":"CWebApplication","type":"->","args":["admin\/export\/sa\/exportMultipleStructureSurveys"]},{"file":"\/var\/www\/html\/vendor\/yiisoft\/yii\/framework\/base\/CApplication.php","line":185,"function":"processRequest","class":"CWebApplication","type":"->","args":[]},{"file":"\/var\/www\/html\/index.php","line":161,"function":"run","class":"CApplication","type":"->","args":[]}]}}

This is my yaml file: limesurvey: image: adamzammit/limesurvey:latest container_name: limesurvey ports:

Can you please help me?

Thanks

adamzammit commented 1 year ago

Was the LimeSurvey version you imported from the same as the current Docker version (i.e was your local version running 6.2.1 and then you imported into the Docker version 6.2.1?).

If not the same my guess is this is a LimeSurvey bug not something specific to the Docker version. If you are happy to share your original survey LSS file from your original version that you imported and now cannot export - please send it to me privately: adam@acspri.org.au and I can assist with debugging

Hooteo commented 1 year ago

Hi @adamzammit i thought the problem was the different version so I've created a new survey on the new configuration and I had the same issue when trying to export the lss. I don't know if the problem is related to the new theme that I personalized that's the only thing that I haven't tried.

adamzammit commented 1 year ago

yes it might be related to the theme - please change the theme of the survey to one of the default LS ones and see if export works then

Hooteo commented 1 year ago

Actually it only fails with the new theme created by changing the default Bootswatch theme. By setting Bootswatch the export works correctly. However, in the previous configuration the export also worked correctly from custom theme. Is it possible to fix this problem or in the future I will be forced to change all templates of the 40 surveys?

adamzammit commented 1 year ago

This is an upstream bug.

I've reported it here: https://bugs.limesurvey.org/view.php?id=19049

Hooteo commented 1 year ago

Thanks! :)