View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
05683Bug reportsOtherpublic2012-03-14 21:08
Reportertpartner Assigned ToTMSWhite  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version1.92RC2 
Target Version1.92RC3Fixed in Version1.92RC3 
Summary05683: Javascript errors with array-numbers question
Description

After updating from 1.91 to 1.92, EM causes JavaScript errors in the attached survey:

syntax error - line 476
ExprMgr_process_relevance_and_tailoring is not defined - line 113

The survey consists of a single array-numbers question with default advanced settings and no custom JS.

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)12464
I will donate to the project if issue is resolvedNo
BrowserFF
Database type & versionMySQL 5.1.41
Server OS (if known)Win
Webserver software & version (if known)Apache/2.2.14
PHP Version5.3.1

Users monitoring this issue

There are no users monitoring this issue.

Activities

tpartner

tpartner

2012-01-23 16:31

partner   ~16911

Tom, I see the same problem with the second group (P2) in the second attached survey (limesurvey_survey_74213.lss).

Again, no custom JS and straight-forward settings.

TMSWhite

TMSWhite

2012-01-23 16:52

reporter   ~16915

The core problem with survey 57699 is that the question names is "arrayNumbersP1-1" - the question code should match this pattern /^[a-zA-Z][0-9a-zA-Z]*$/

If you look at the Survey Logic File for 57699, you will see lots of undefined variables.

Survey 74213 has the same problem - it us using a minus sign in the question code/name.

The logic file highlights these errors, and gives users the ability to easily fix them. So, this is not a bug per-say, but rather highlights a need for better documentation, and perhaps regex filters when people enter question codes to ensure that they are valid.

TMSWhite

TMSWhite

2012-01-23 16:53

reporter   ~16916

Per the notes, this is not a bug in the code, but highlights a need for better documentation.

tpartner

tpartner

2012-01-23 17:11

partner   ~16926

But...what about poeple with existing surveys with these characters in question names?

TMSWhite

TMSWhite

2012-01-23 17:16

reporter   ~16927

Recommendations? One option is to convert unacceptable characters within question codes to underscores.

The other problem is that sometimes people re-use the same question code across groups. An option there might be to add a counter suffix to them to force them to be unique.

This gets even trickier for cases like the sample survey where question codes ':', ';', and other single characters are used. All of them would just be converted to '_', so we'd have to do a second round of uniqueness checking.

The question/group renumbering feature does work for people with such surveys. The question codes won't mean anything anymore, but the surveys will run.

tpartner

tpartner

2012-01-23 17:41

partner   ~16929

I'm afraid I don't have a solid recommendation but I am concerned about the compatability with existing surveys.

TMSWhite

TMSWhite

2012-01-23 18:14

reporter   ~16931

There may be a relatively simple solution.

The auto-generated code uses the qcode names. If I were to use the SGQA names instead, it should let the old surveys work.

I'd still want to report that the qcodes are deprecated (not recommended), but may not need to show them as actual errors.

I need to think about this some more. My main concern is that the generated JavaScript is currently nice and readable since it uses qcode values. If we change all equations to using SGQA, the JavaScript will be impossible to comprehend. The Show Logic File view should still be OK.

Perhaps Carsten can weigh in on this.

TMSWhite

TMSWhite

2012-01-23 18:15

reporter   ~16932

Assigning to Carsten just so he can weigh in. I'll implement the fix when we have a strategy.

TMSWhite

TMSWhite

2012-01-25 07:24

reporter   ~16967

Fixed in revision 12194

c_schmitz

c_schmitz

2012-01-30 18:41

administrator   ~17064

1.92RC3 released

Related Changesets

LimeSurvey: Yii 61305566

2012-01-24 22:25:21

TMSWhite

Details Diff
Fixed issue 05683: Javascript errors with array-numbers question
Dev Core problem was that EM internally uses qcode names on auto-generated equations. So, if the qcodes are invalid, things fail
Dev Added option to use and generate legacy SGQA codes (this option is on by default)
Dev Changed Show Logic File to not count poorly named qcodes as errors, but instead highlight them in pink so that users can optionally fix them
Dev Added option to always show SGQA values (instead of qcodes). This is off by default.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@12195 b72ed6b6-b9f8-46b5-92b4-906544132732
Affected Issues
05683
mod - application/helpers/expressions/em_core_helper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File

Issue History

Date Modified Username Field Change
2012-01-23 16:06 tpartner New Issue
2012-01-23 16:06 tpartner Status new => assigned
2012-01-23 16:06 tpartner Assigned To => TMSWhite
2012-01-23 16:06 tpartner File Added: limesurvey_survey_57699.lss
2012-01-23 16:29 tpartner File Added: limesurvey_survey_74213.lss
2012-01-23 16:31 tpartner Note Added: 16911
2012-01-23 16:52 TMSWhite Note Added: 16915
2012-01-23 16:53 TMSWhite Note Added: 16916
2012-01-23 16:53 TMSWhite Status assigned => resolved
2012-01-23 16:53 TMSWhite Resolution open => no change required
2012-01-23 17:11 tpartner Note Added: 16926
2012-01-23 17:12 tpartner Status resolved => feedback
2012-01-23 17:12 tpartner Resolution no change required => reopened
2012-01-23 17:16 TMSWhite Note Added: 16927
2012-01-23 17:41 tpartner Note Added: 16929
2012-01-23 17:41 tpartner Status feedback => assigned
2012-01-23 18:14 TMSWhite Note Added: 16931
2012-01-23 18:14 TMSWhite Assigned To TMSWhite => c_schmitz
2012-01-23 18:15 TMSWhite Note Added: 16932
2012-01-25 07:24 TMSWhite Note Added: 16967
2012-01-25 07:24 TMSWhite Status assigned => resolved
2012-01-25 07:24 TMSWhite Fixed in Version => 1.92RC3
2012-01-25 07:24 TMSWhite Resolution reopened => fixed
2012-01-25 07:24 TMSWhite Assigned To c_schmitz => TMSWhite
2012-01-30 18:41 c_schmitz Note Added: 17064
2012-01-30 18:41 c_schmitz Status resolved => closed
2012-03-14 21:08 TMSWhite Changeset attached => Import 2012-03-09 13:30:34 Yii 61305566