View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
18362Bug reportsOtherpublic2024-09-04 11:59
ReporterDenisChenu Assigned Toc_schmitz  
PrioritynoneSeverityminor 
Status closedResolutionunable to reproduce 
Product Version5.4.x 
Summary18362: Update from 3.X broke with question theme
Description

When update via console : error throw with some question theme

Steps To Reproduce

Steps to reproduce

Have some old question theme in directory
update via command line

Expected result

Update until last DB

Actual result

E:\WebSite\limesurvey>php application/commands/console.php updatedb
Update sqlsrv:Server=DMZ-SQL19-ST-1;Database=LimeSurvey with prefix :lime_ from 365 to 491
PHP Error[2]: count(): Parameter must be an array or an object that implements Countable
in file E:\WebSite\limesurvey\application\models\QuestionTheme.php at line 894
#0 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\base\CApplication.php(832): CErrorHandler->handle()
#1 E:\WebSite\limesurvey\application\models\QuestionTheme.php(894): ConsoleApplication->handleError()
#2 E:\WebSite\limesurvey\application\helpers\update\updates\Update_425.php(18): convertLS3toLS5()
#3 E:\WebSite\limesurvey\application\helpers\update\DatabaseUpdateBase.php(47): LimeSurvey\Helpers\Update\Update_425->up()
#4 E:\WebSite\limesurvey\application\helpers\update\updatedb_helper.php(88): LimeSurvey\Helpers\Update\Update_425->safeUp()
#5 E:\WebSite\limesurvey\application\commands\UpdateDbCommand.php(46): db_upgrade_all()
#6 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\console\CConsoleCommandRunner.php(71): UpdateDBCommand->run()
#7 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\console\CConsoleApplication.php(92): CConsoleCommandRunner->run()
#8 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\base\CApplication.php(185): ConsoleApplication->processRequest()
#9 E:\WebSite\limesurvey\application\commands\console.php(77): ConsoleApplication->run()

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)5.4.1
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionMSSQL
Server OS (if known)windows
Webserver software & version (if known)IIS
PHP Version7.2.16

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-09-20 11:50

developer   ~71848

Fixed with !empty($oThemeConfig->compatibility->version) at https://github.com/LimeSurvey/LimeSurvey/blob/e871bea897585edf28de26d0723bf02d746210f7/application/models/QuestionTheme.php#L893

DenisChenu

DenisChenu

2022-09-20 11:52

developer   ~71849

After the quick fix :

E:\WebSite\limesurvey>php application/commands/console.php updatedb
Update sqlsrv:Server=DMZ-SQL19-ST-1;Database=LimeSurvey with prefix :lime_ from 424 to 491
PHP Error[8]: Array to string conversion
in file E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\db\schema\CDbColumnSchema.php at line 146
#0 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\base\CApplication.php(832): CErrorHandler->handle()
#1 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\db\schema\CDbColumnSchema.php(146): ConsoleApplication->handleError()
#2 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\db\schema\mssql\CMssqlColumnSchema.php(86): CMssqlColumnSchema->typecast()
#3 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\db\schema\CDbCommandBuilder.php(229): CMssqlColumnSchema->typecast()
#4 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\db\ar\CActiveRecord.php(1082): CMssqlCommandBuilder->createInsertCommand()
#5 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\db\ar\CActiveRecord.php(811): QuestionTheme->insert()
#6 E:\WebSite\limesurvey\application\models\QuestionTheme.php(284): QuestionTheme->save()
#7 E:\WebSite\limesurvey\application\helpers\update\updates\Update_425.php(21): QuestionTheme->importManifest()
#8 E:\WebSite\limesurvey\application\helpers\update\DatabaseUpdateBase.php(47): LimeSurvey\Helpers\Update\Update_425->up()
#9 E:\WebSite\limesurvey\application\helpers\update\updatedb_helper.php(88): LimeSurvey\Helpers\Update\Update_425->safeUp()
#10 E:\WebSite\limesurvey\application\commands\UpdateDbCommand.php(46): db_upgrade_all()
#11 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\console\CConsoleCommandRunner.php(71): UpdateDBCommand->run()
#12 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\console\CConsoleApplication.php(92): CConsoleCommandRunner->run()
#13 E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\base\CApplication.php(185): ConsoleApplication->processRequest()
#14 E:\WebSite\limesurvey\application\commands\console.php(77): ConsoleApplication->run()

I delete all theme in upload/theme/question and let it go …

My opinion : Do not try to update automatically question theme, just check if it's compatible , if not : uninstal.

c_schmitz

c_schmitz

2024-09-04 10:15

administrator   ~80891

I just checked with an upgrade from 3 to 6 and could not reproduce anymore, so I guess it is fixed.

DenisChenu

DenisChenu

2024-09-04 11:58

developer   ~80894

yes : seems there are a fix https://github.com/LimeSurvey/LimeSurvey/blob/056ef5fc47c95ee8a06f34c7f7db4fe9d7024b78/application/models/QuestionTheme.php#L901

DenisChenu

DenisChenu

2024-09-04 11:59

developer   ~80895

PS : still think than updating config.xml file are a bad idea.

We know than between 3 and 5 : there are no real Question/ Survey theme compatibility …

Issue History

Date Modified Username Field Change
2022-09-20 11:49 DenisChenu New Issue
2022-09-20 11:50 DenisChenu Note Added: 71848
2022-09-20 11:50 DenisChenu Bug heat 0 => 2
2022-09-20 11:52 DenisChenu Note Added: 71849
2022-09-24 00:00 gabrieljenik Status new => acknowledged
2024-09-04 10:15 c_schmitz Assigned To => c_schmitz
2024-09-04 10:15 c_schmitz Status acknowledged => closed
2024-09-04 10:15 c_schmitz Resolution open => unable to reproduce
2024-09-04 10:15 c_schmitz Note Added: 80891
2024-09-04 10:15 c_schmitz Bug heat 2 => 4
2024-09-04 11:58 DenisChenu Note Added: 80894
2024-09-04 11:59 DenisChenu Note Added: 80895