View Issue Details

This issue affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
13641Feature requestsSurvey editingpublic2018-05-16 12:46
Reporterdietrich Assigned ToLouisGac 
PrioritynoneSeverityfeature 
Status closedResolutionfixed 
Summary13641: Allow PHP files in User Question Templates.
Description

Hello,

What is the reason for restriction User Question Templates to just twig files?

The core question templates located at
limesurvey/application/views/survey/questions/answer/
are either .twig files like in multiplechoice/rows
or
.php files like in listradio/rows/

The User question templates which are located under
upload/themes/question/MYTEMPLATE/survey/questions/answer/
can only be of twig type of files.

In the file: ./application/models/QuestionTemplate.php

/**

  • Check if the question template offer a specific replacement for that view file.
  • @param string $sView
  • @return mixed
    */
    public function checkIfTemplateHasView($sView)
    {
    if (!isset($this->aViews[$sView])) {
    $sTemplatePath = $this->getTemplatePath();
    if (is_file("$sTemplatePath/$sView.twig")) {
    $this->aViews[$sView] = true;
    } else {
    $this->aViews[$sView] = false;
    }
    }
    return $this->aViews[$sView];
    }

the IF condition just checks for the existence of a twig file, but not for a php file.
This should be added to allow php user question templates like in the core.

Thank you
Dietrich

TagsNo tags attached.
Bug heat2
Story point estimate
Users affected %

Users monitoring this issue

There are no users monitoring this issue.

Activities

LouisGac

LouisGac

2018-05-16 12:46

developer   ~47625

it was for security reason: we have a sandbox for twig, to be sure that the user is not going to do dangerous things (DB, File System, etc)
Now, all the core views has been translated to twig, so I close that ticket.

Issue History

Date Modified Username Field Change
2018-04-27 14:39 dietrich New Issue
2018-05-16 12:46 LouisGac Note Added: 47625
2018-05-16 12:46 LouisGac Assigned To => LouisGac
2018-05-16 12:46 LouisGac Status new => closed
2018-05-16 12:46 LouisGac Resolution open => fixed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing