Skip to content

Commit

Permalink
Fixed issue #18246: The setting in the theme variation field (global …
Browse files Browse the repository at this point in the history
…level) is not shown (#2510)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
  • Loading branch information
gabrieljenik and encuestabizdevgit committed May 30, 2023
1 parent ab5bbce commit 449f90c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion application/models/TemplateConfiguration.php
Expand Up @@ -1581,12 +1581,18 @@ public function setOptionKeysToInherit()
*/
public function sanitizeImagePathsOnJson($attribute, $params)
{
$excludedOptions = [
'cssframework'
];
// Validates all options of the theme. Not only classic ones which are expected to hold a path,
// as other options may hold a path as well (eg. custom theme options)
$decodedOptions = json_decode((string) $this->$attribute, true);
if (is_array($decodedOptions)) {
Yii::import('application.helpers.SurveyThemeHelper');
foreach ($decodedOptions as &$value) {
foreach ($decodedOptions as $option => &$value) {
if (in_array($option, $excludedOptions)) {
continue;
}
$value = SurveyThemeHelper::sanitizePathInOption($value, $this->template_name, $this->sid);
}
$this->$attribute = json_encode($decodedOptions);
Expand Down

0 comments on commit 449f90c

Please sign in to comment.