Skip to content

Commit

Permalink
Fixed issue #18031: Question editing broke with PHP warning with dele…
Browse files Browse the repository at this point in the history
…ted questionthemes (#2425)
  • Loading branch information
Shnoulle committed May 19, 2022
1 parent cc497d9 commit b174a7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion application/models/QuestionTheme.php
Expand Up @@ -658,7 +658,11 @@ public static function findAllQuestionMetaDataForSelector()
$baseQuestionsModified = [];
foreach ($baseQuestions as $baseQuestion) {
//TODO: should be moved into DB column (question_theme_settings table)
$sQuestionConfigFile = file_get_contents($baseQuestion->xml_path . DIRECTORY_SEPARATOR . 'config.xml'); // @see: Now that entity loader is disabled, we can't use simplexml_load_file; so we must read the file with file_get_contents and convert it as a string
$sQuestionConfigFile = @file_get_contents($baseQuestion->xml_path . DIRECTORY_SEPARATOR . 'config.xml'); // @see: Now that entity loader is disabled, we can't use simplexml_load_file; so we must read the file with file_get_contents and convert it as a string
if (!$sQuestionConfigFile) {
/* Not readable file : don't break */
continue;
}
$oQuestionConfig = simplexml_load_string($sQuestionConfigFile);
$questionEngineData = json_decode(json_encode($oQuestionConfig->engine), true);
$showAsQuestionType = $questionEngineData['show_as_question_type'];
Expand Down

0 comments on commit b174a7d

Please sign in to comment.