View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
18862 | Bug reports | Expression Manager | public | 2023-06-06 17:35 | 2023-08-18 17:42 |
Reporter | Coreyfournier | Assigned To | |||
Priority | none | Severity | partial_block | ||
Status | feedback | Resolution | open | ||
Product Version | 6.1.x | ||||
Summary | 18862: Expression manager doesn't resolve jsName | ||||
Description | In the file em_manager_helper there is a logic error that never resolves jsName or JsName_on. This is in the function _GetVarAttribute. In the case JsName the logic is below: return (isset($var['jsName_on']) ? $var['jsName_on'] : isset($var['jsName'])) ? $var['jsName'] : $default; It has nested inline if statements. The first in line is passed to the next. The output of the first if is not a boolean "$var['jsName_on']", but the second is "isset($var['jsName'])". The whole statement is basically jacked up as it's a string as input into another if statement. This isn't the only problem as the below code in the function setVariableAndTokenMappingsForExpressionManager always clears out js name on. So "isset($var['jsName_on'])" is always true and set to an empty string.
I think the logic should be rewritten as follows : if(isset($var['jsName'])) | ||||
Steps To Reproduce | Steps to reproduceAdd a question and an expression to use the Question.jsName. Expected resultjava{SurveyId}X{Id}X{Id} Actual resultNothing (Write here what happened instead) | ||||
Tags | No tags attached. | ||||
Bug heat | 4 | ||||
Complete LimeSurvey version number (& build) | 6.1 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | Mysql | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | Latest | ||||
The function clear jsVarName_on for hidden question. Hidden question are not in page, there don't have a jsVarName
Please : a sample survey |
|
@Coreyfournier could you please provide a sample survey where this is happening? |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2023-06-06 17:35 | Coreyfournier | New Issue | |
2023-06-06 17:56 | DenisChenu | Note Added: 75451 | |
2023-06-06 17:56 | DenisChenu | Bug heat | 0 => 2 |
2023-08-17 15:48 | tibor.pacalat | Assigned To | => tibor.pacalat |
2023-08-17 15:48 | tibor.pacalat | Status | new => feedback |
2023-08-17 15:48 | tibor.pacalat | Note Added: 76632 | |
2023-08-17 15:48 | tibor.pacalat | Bug heat | 2 => 4 |
2023-08-18 17:42 | tibor.pacalat | Assigned To | tibor.pacalat => |