Skip to content

Commit

Permalink
Fixd issue #18031: Broken theme broke with 500 error (#2390)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed May 3, 2022
1 parent d3112c8 commit 8d8420a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion application/models/QuestionTheme.php
Expand Up @@ -529,7 +529,7 @@ public static function uninstall($oQuestionTheme)
}

// todo optimize function for very big surveys, eventually in yii 2 or 3 with batch processing / if this is breaking in Yii 1 use CDbDataReader $query = new CDbDataReader($command), $query->read()
$aQuestions = Question::model()->findAll(
$aQuestions = Question::model()->count(
'type = :type AND question_theme_name = :theme AND parent_qid = :parent_qid',
[
':type' => $oQuestionTheme->question_type,
Expand Down
Expand Up @@ -43,10 +43,10 @@ protected function getAttributesFromQuestionTheme($questionThemeName, $questionT
if ($questionTheme !== null) {
$xmlFilePath = $questionTheme['xml_path'] . '/config.xml';
$extensionConfig = \ExtensionConfig::loadFromFile($xmlFilePath);
$xmlAttributes = $extensionConfig->getNodeAsArray('attributes');
}

if (!empty($xmlAttributes)) {
if (!empty($extensionConfig)) {
$xmlAttributes = $extensionConfig->getNodeAsArray('attributes');
if (!empty($xmlAttributes['attribute']['name'])) {
// Only one attribute set in config: need an array of attributes
$xmlAttributes['attribute'] = array($xmlAttributes['attribute']);
Expand Down

0 comments on commit 8d8420a

Please sign in to comment.