View Issue Details

IDProjectCategoryView StatusLast Update
13180Bug reports[All Projects] Survey takingpublic2018-02-22 14:18
Reportercookiemonster Assigned Tomarkusfluer  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version3.1.x 
Summary13180: Variables don't work in END_URL
Description

Variables don't work in END_URL

Steps To Reproduce

use a variable in END_URL

Additional Information

I raised this ticket as https://bugs.limesurvey.org/view.php?id=13156 was closed with fixed in 3.0.3, but this affected variables in general, not the end_url vars - definitely not fixed in 3.03.

TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 3.0.3+180112
I will donate to the project if issue is resolvedNo
BrowserFirefox 57.0.4 (64-Bit)
Database & DB-Versionlibmysql - 5.5.54
Server OS (if known)Ubuntu
Webserver software & version (if known)Apache/2.4.7
PHP Version5.5.9

Relationships

related to 13156 closedLouisGac Some Variables are not working in ongoing survey: ASSESSMENT_CURRENT_TOTAL and TOKEN:TOKEN 

Activities

LouisGac

LouisGac

2018-01-23 10:33

manager   ~45961

Last edited: 2018-01-23 10:35

View 2 revisions

markus, have a look how I fixed it for question text:
https://github.com/LimeSurvey/LimeSurvey/commit/cd2341a82471975d376abf0c00db2612fd16eca2

First we check if the srting contains a '{' to avoid useless logic:
https://github.com/LimeSurvey/LimeSurvey/blob/93eda227d917a0c142d524fe91949eb951d0bc36/application/helpers/SurveyRuntimeHelper.php#L374-L380

So you can move this test in a function out of surveyRuntime

Then, if it has a '{', it will call the function getStandardsReplacementFields to generate the Standard Replacement Fields and their current value:
https://github.com/LimeSurvey/LimeSurvey/blob/93eda227d917a0c142d524fe91949eb951d0bc36/application/helpers/SurveyRuntimeHelper.php#L377

The function getStandardsReplacementFields is defined here, based on the old templatereplace (so if some standard variables are missing, you should find them in templatereplace):
https://github.com/LimeSurvey/LimeSurvey/blob/93eda227d917a0c142d524fe91949eb951d0bc36/application/helpers/replacements_helper.php#L362-L481
https://github.com/LimeSurvey/LimeSurvey/blob/93eda227d917a0c142d524fe91949eb951d0bc36/application/helpers/replacements_helper.php#L34

THen finally the replacement is done via the EM here:
https://github.com/LimeSurvey/LimeSurvey/blob/93eda227d917a0c142d524fe91949eb951d0bc36/application/helpers/SurveyRuntimeHelper.php#L386

So globally, getStandardsReplacementFields should be called only once (or it should use a cache), and then you can apply it doing:

LimeExpressionManager::ProcessString("HERE THE STRING WHITHT SOME VARIABLES ", $qa[4], $aStandardsReplacementFields, 3, 1, false, true, false);

LouisGac

LouisGac

2018-01-26 14:35

manager   ~46111

Btw:
https://github.com/LimeSurvey/LimeSurvey/blob/master/themes/survey/vanilla/views/subviews/content/submit.twig#L71

{# NOTE: not very clear what the old replacement keyword {URL} was doing #}

Now I know ^^

LouisGac

LouisGac

2018-01-26 17:35

manager   ~46116

https://github.com/LimeSurvey/LimeSurvey/commit/4a8c0285161aa56c5dcec9f72e3bb9467d0e1b9a

ollehar

ollehar

2018-01-30 14:27

administrator   ~46149

Fixed in 3.1.1.

cookiemonster

cookiemonster

2018-01-31 13:10

reporter   ~46177

still not fixed in Version 3.1.1+180130
it still shows {variable} instead of the variable's content

cookiemonster

cookiemonster

2018-01-31 13:17

reporter   ~46178

LSS attached (LSA doesn't work, will create another bug report for that)



limesurvey_survey_498847.lss (17,504 bytes)
cookiemonster

cookiemonster

2018-02-01 08:37

reporter   ~46190

I raised a new ticket as I'm not sure if you're following "closed" bugs :)
https://bugs.limesurvey.org/view.php?id=13280

Issue History

Date Modified Username Field Change
2018-01-15 10:41 cookiemonster New Issue
2018-01-15 11:28 LouisGac Relationship added related to 13156
2018-01-23 10:28 LouisGac Assigned To => markusfluer
2018-01-23 10:28 LouisGac Status new => assigned
2018-01-23 10:33 LouisGac Note Added: 45961
2018-01-23 10:35 LouisGac Note Edited: 45961 View Revisions
2018-01-26 14:14 LouisGac Sticky Issue No => Yes
2018-01-26 14:35 LouisGac Note Added: 46111
2018-01-26 17:35 LouisGac Note Added: 46116
2018-01-26 17:35 LouisGac Status assigned => resolved
2018-01-26 17:35 LouisGac Resolution open => fixed
2018-01-26 17:35 LouisGac Fixed in Version => 3.1.x
2018-01-30 14:27 ollehar Status resolved => closed
2018-01-30 14:27 ollehar Note Added: 46149
2018-01-31 13:10 cookiemonster Note Added: 46177
2018-01-31 13:17 cookiemonster File Added: limesurvey_survey_498847.lss
2018-01-31 13:17 cookiemonster Note Added: 46178
2018-02-01 08:37 cookiemonster Note Added: 46190
2018-02-22 14:18 c_schmitz Sticky Issue Yes => No