Skip to content

Commit

Permalink
Fixed issue #17121: Customq question preview image not shown (#1790)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljenik committed Mar 11, 2021
1 parent abebe9b commit d8dbbeb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions application/models/QuestionTheme.php
Expand Up @@ -411,7 +411,6 @@ public static function getQuestionMetaData($pathToXML)
foreach ($questionDirectories as $key => $questionDirectory) {
$questionDirectories[$key] = str_replace('\\', '/', $questionDirectory);
}
$publicurl = App()->getConfig('publicurl');

$pathToXML = str_replace('\\', '/', $pathToXML);
if (\PHP_VERSION_ID < 80000) {
Expand Down Expand Up @@ -459,7 +458,7 @@ public static function getQuestionMetaData($pathToXML)
// get custom previewimage if defined
if (!empty($oQuestionConfig->files->preview->filename)) {
$previewFileName = json_decode(json_encode($oQuestionConfig->files->preview->filename), true)[0];
$questionMetaData['image_path'] = $publicurl . $pathToXML . '/assets/' . $previewFileName;
$questionMetaData['image_path'] = DIRECTORY_SEPARATOR . $pathToXML . '/assets/' . $previewFileName;
}

$questionMetaData['xml_path'] = $pathToXML;
Expand Down

0 comments on commit d8dbbeb

Please sign in to comment.