PHP warning

count(): Parameter must be an array or an object that implements Countable

E:\WebSite\limesurvey\application\models\QuestionTheme.php(894)

882         if (\PHP_VERSION_ID < 80000) {
883             libxml_disable_entity_loader($bOldEntityLoaderState);
884         }
885 
886         // get type from core theme
887         if (isset($oThemeConfig->metadata->type)) {
888             $oThemeConfig->metadata->type = 'question_theme';
889         } else {
890             $oThemeConfig->metadata->addChild('type', 'question_theme');
891         };
892 
893         // set compatibility version
894         if (count($oThemeConfig->compatibility->version) > 1) {
895             $length = count($oThemeConfig->compatibility->version);
896             $compatibility = $oThemeConfig->addChild('compatibility');
897             $compatibility->addChild('version');
898             $oThemeConfig->compatibility->version[$length] = '5.0';
899         } elseif (count($oThemeConfig->compatibility->version) === 1) {
900             $oThemeConfig->compatibility->version = '5.0';
901         } else {
902             $compatibility = $oThemeConfig->addChild('compatibility');
903             $compatibility->addChild('version');
904             $oThemeConfig->compatibility->version = '5.0';
905         }
906 

Stack Trace

#0
+
 E:\WebSite\limesurvey\application\helpers\update\updates\Update_425.php(18): QuestionTheme::convertLS3toLS5("upload/themes/question/arraytext_display_rows/survey/questions/a...")
13         if (!empty($aUserDirectory)) {
14             reset($aUserDirectory);
15             $aUserXMLPaths = key($aUserDirectory);
16             foreach ($aUserDirectory[$aUserXMLPaths] as $sXMLDirectoryPath) {
17                 try {
18                     $aSuccess = QuestionTheme::convertLS3toLS5($sXMLDirectoryPath);
19                     if ($aSuccess['success']) {
20                         $oQuestionTheme = new QuestionTheme();
21                         $oQuestionTheme->importManifest($sXMLDirectoryPath, true);
22                     }
23                 } catch (Throwable $e) {
#1
+
 E:\WebSite\limesurvey\application\helpers\update\DatabaseUpdateBase.php(47): LimeSurvey\Helpers\Update\Update_425->up()
42      */
43     public function safeUp()
44     {
45         $transaction = $this->db->beginTransaction();
46         try {
47             $this->up();
48             $this->updateVersion();
49             $transaction->commit();
50         } catch (Throwable $e) {
51             $transaction->rollback();
52             throw $e;
#2
+
 E:\WebSite\limesurvey\application\helpers\update\updatedb_helper.php(88): LimeSurvey\Helpers\Update\DatabaseUpdateBase->safeUp()
83     try {
84         // Get all relevant files from updates/ folder
85         $updates = getRelevantUpdates($iOldDBVersion, Yii::app()->db, $options);
86         foreach ($updates as $update) {
87             // NB: safeUp() wraps up() inside a transaction and also updates DBVersion.
88             $update->safeUp();
89         }
90     } catch (Exception $e) {
91         Yii::app()->setConfig('Updating', false);
92         // Activate schema caching
93         $oDB->schemaCachingDuration = 3600;
2023-07-12 10:30:26 Microsoft-IIS/10.0 Yii Framework/1.1.28