View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
05541Bug reportsSurvey takingpublic2012-03-14 21:12
Reporterjcleeland Assigned ToTMSWhite  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00a2 
Target Version2.00a2Fixed in Version1.92RC2 
Summary05541: Certain LimeReplacementFields no longer working in 2.00
Description

{QID} and {SGQ} are no longer working in version 2

Steps To Reproduce

Create a survey. Create a group. Create a single question. Insert, in the question text, the values {QID} and {SGQ}. These should be replaced, when the survey is run, with the value for the question id, and the SGQA value. However, instead they are reported as undefined variables according to the EM category. Sample survey attached.

TagsNo tags attached.
Attached Files
qid not working.lss (15,775 bytes)
Bug heat4
Complete LimeSurvey version number (& build)2
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmysql
Server OS (if known)windows
Webserver software & version (if known)apache2
PHP Version5something

Users monitoring this issue

There are no users monitoring this issue.

Activities

TMSWhite

TMSWhite

2011-10-31 21:13

reporter   ~16577

Jason-

{QID} and {SGQA} are working inconsistently. If you use {QID} and {SGQA} in the Help section of your question, you will see the proper values. So, EM isn't been informed of the QID and SGQA values prior to expansion of the Title and Question text. I'll dig deeper.

TMSWhite

TMSWhite

2011-11-01 15:51

reporter   ~16580

Jason-

The root cause is that replacements_helper needs to have $question set in order to populate QID and SGQA (see line 100 of replacements_helper.php). This comes through via the new $redata array (which has been a pain to debug).

Running a normal survey, I only see $question populated and passed through to template_replace from these points:
Group_format[1343]
Group_format[1359]
Group_format[1371]
Group_format[1476]

However, ExpressionManager thinks it is done after the second call, and the QID replacements were done before the first call. This explains why Help Text has the proper QID value (since it is called late) and the others don't.

We really need to refactor the whole process of composing a page and doing replacements. I'll see what I can do short term first.

Any help you could provide would also be appreciated.

TMSWhite

TMSWhite

2011-12-30 01:11

reporter   ~16765

This was fixed prior to the release of _CI branch 2.0a, at least 1.5 months ago, but I don't recall the exact version number.

c_schmitz

c_schmitz

2012-01-20 13:08

administrator   ~16839

1.92RC2 released.

TMSWhite

TMSWhite

2012-03-14 21:08

reporter   ~17923

Fix committed to Yii branch.

Related Changesets

LimeSurvey: Yii 08eef706

2011-11-03 08:08:21

TMSWhite

Details Diff
Fixed 05541: Certain LimeReplacementFields no longer working in 2.00
Dev Core problem was that Dtexts was calling EM before variables were properly set. Refactored so as to completely remove Dtexts.
Dev Works for Group-by-Group mode
Dev Needs to be tested for other survey modes, and for surveyls_url and email generation. If this change breaks those, then can create a different function to do EM replacements for those.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11316 b72ed6b6-b9f8-46b5-92b4-906544132732
Affected Issues
05541
rm - application/libraries/Dtexts.php Diff File
mod - application/controllers/survey.php Diff File
mod - application/helpers/expressions/em_core_helper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/frontend_helper.php Diff File
mod - application/helpers/qanda_helper.php Diff File
mod - application/helpers/replacements_helper.php Diff File
mod - application/libraries/Group_format.php Diff File
mod - application/libraries/Question_format.php Diff File
mod - application/libraries/Survey_format.php Diff File

LimeSurvey: Yii 3445cdc5

2011-11-03 10:08:07

TMSWhite

Details Diff
Fixed 05541: Certain LimeReplacementFields no longer working in 2.00
Dev Works for All-in-one mode

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11318 b72ed6b6-b9f8-46b5-92b4-906544132732
Affected Issues
05541
mod - application/libraries/Survey_format.php Diff File

Issue History

Date Modified Username Field Change
2011-10-29 11:56 jcleeland New Issue
2011-10-29 11:56 jcleeland Status new => assigned
2011-10-29 11:56 jcleeland Assigned To => TMSWhite
2011-10-29 11:58 jcleeland File Added: qid not working.lss
2011-10-31 21:13 TMSWhite Note Added: 16577
2011-11-01 15:51 TMSWhite Note Added: 16580
2011-12-30 01:11 TMSWhite Note Added: 16765
2011-12-30 01:11 TMSWhite Status assigned => resolved
2011-12-30 01:11 TMSWhite Fixed in Version => 2.00a1
2011-12-30 01:11 TMSWhite Resolution open => fixed
2012-01-20 13:07 c_schmitz Fixed in Version 2.00a1 => 1.92RC2
2012-01-20 13:08 c_schmitz Note Added: 16839
2012-01-20 13:08 c_schmitz Status resolved => closed
2012-03-14 21:08 TMSWhite Changeset attached => Import 2012-03-09 13:30:34 Yii 3445cdc5
2012-03-14 21:08 TMSWhite Changeset attached => Import 2012-03-09 13:30:34 Yii 08eef706
2012-03-14 21:08 TMSWhite Note Added: 17923
2012-03-14 21:08 TMSWhite Status closed => resolved
2012-03-14 21:12 c_schmitz Status resolved => closed