View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
18362Bug reportsOtherpublic2022-09-24 00:00
ReporterDenisChenu Assigned To 
PrioritynoneSeverityminor 
Status acknowledgedResolutionopen 
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 heat2
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

User List 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.

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