View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
13944Bug reportsTheme editorpublic2019-04-30 09:10
ReporterVCmarcel Assigned ToLouisGac 
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Summary13944: Template variable for survey title is empty when the survey is prompting for a token
Description

I am creating my own template with the new twig template engine.
In the file "layout_global.twig" I've added the following code directly after the opening body tag:

<!-- Survey Name -->
<h1 class="{{ aSurveyInfo.class.surveyname }} text-center" {{ aSurveyInfo.attr.surveyname }} >
{{ processString(aSurveyInfo.name,1) }}
</h1>

(I've copied this tiny piece of code from the welcome.twig file (line 27-30).)

After setting this <h1> Tag directly after the opening <body> tag, the surveyname should be now displayed on every page.
On the welcome page and the question pages the surveyname will be shown correctly.
After setting my survey to "closed mode" where you need a valid token, the template variable won't be filled correctly when the token prompt appears also the <title> tag from the head.twig file won't be filled correctly with the survey name

I've attached the following files:
layout_global.jpg -> Here you can see my custom div-container in the layout_global.twig file with the template variable
head_twig.jpg -> a screenshot from the <title> tag from the head.twig file
correct.jpg -> a screenshot where you can see the correctly filled template variable with the correct output (after token prompt)
notcorrect.jpg -> a screenshot where you can see, that the template variable for the surveyname isn't filled correctly (at token prompt)

Steps To Reproduce
  1. extend the vanilla theme
  2. add the following code directly after the body tag in layout_global.twig
    <!-- Survey Name -->
    <h1 class="{{ aSurveyInfo.class.surveyname }} text-center" {{ aSurveyInfo.attr.surveyname }} >
    {{ processString(aSurveyInfo.name,1) }}
    </h1>
  3. create a survey with example questions
  4. add the extended vanilla theme to your created survey
  5. Initialize a participant table
  6. add a user with token 1234
  7. test the survey
  8. You will see that the survey title (directly after the body and in the browser tab) is not displayed at the token prompt
  9. enter the token
  10. You will see that the survey title is displayed correctly (after the body tag and browser tab)
Additional Information

My limesurvey installation is running locally on my windows 7 machine with xampp

TagsNo tags attached.
Attached Files
correct.JPG (36,917 bytes)   
correct.JPG (36,917 bytes)   
head_twig.JPG (11,658 bytes)   
head_twig.JPG (11,658 bytes)   
layout_global.JPG (44,894 bytes)   
layout_global.JPG (44,894 bytes)   
notcorrect.JPG (60,757 bytes)   
notcorrect.JPG (60,757 bytes)   
templateeditor.png (85,093 bytes)   
templateeditor.png (85,093 bytes)   
html.png (624,967 bytes)
Bug heat4
Complete LimeSurvey version number (& build)3.14.2+180807
I will donate to the project if issue is resolvedNo
BrowserFirefox Quantum 61.0.1
Database type & versionMariaDB 10.1.34
Server OS (if known)Windows 7 (local installation)
Webserver software & version (if known)XAMPP
PHP Version7.2.7

Relationships

related to 14074 closedLouisGac aSurveyInfo is not available on Token page 

Users monitoring this issue

There are no users monitoring this issue.

Activities

Mazi

Mazi

2018-09-19 11:10

updater   ~49086

We are facing the same problem. aSurveyInfo.name doesn't get replaced with the survey title at the token entry screen.

LouisGac

LouisGac

2018-09-19 11:24

developer   ~49087

I confirm aSurveyInfo is not set in token entry page....

LouisGac

LouisGac

2018-09-19 11:29

developer   ~49088

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=27971

Related Changesets

LimeSurvey: master 85c98cba

2018-09-19 11:29:16

LouisGac

Details Diff
Fixed issue 13944: Template variable for survey title is empty when the survey is prompting for a token Affected Issues
13944
mod - application/helpers/frontend_helper.php Diff File

Issue History

Date Modified Username Field Change
2018-08-07 15:31 VCmarcel New Issue
2018-08-07 15:31 VCmarcel File Added: correct.JPG
2018-08-07 15:31 VCmarcel File Added: head_twig.JPG
2018-08-07 15:31 VCmarcel File Added: layout_global.JPG
2018-08-07 15:31 VCmarcel File Added: notcorrect.JPG
2018-08-07 15:43 Mazi Assigned To => LouisGac
2018-08-07 15:43 Mazi Status new => assigned
2018-09-19 11:06 Mazi Relationship added related to 14074
2018-09-19 11:09 Mazi File Added: templateeditor.png
2018-09-19 11:09 Mazi File Added: html.png
2018-09-19 11:10 Mazi Note Added: 49086
2018-09-19 11:24 LouisGac Note Added: 49087
2018-09-19 11:29 LouisGac Changeset attached => LimeSurvey master 85c98cba
2018-09-19 11:29 LouisGac Note Added: 49088
2018-09-19 11:29 LouisGac Resolution open => fixed
2018-09-19 13:35 LouisGac Status assigned => resolved
2019-04-30 09:10 c_schmitz Status resolved => closed