View Issue Details

IDProjectCategoryView StatusLast Update
13630Bug reports[All Projects] Expression Managerpublic2018-11-25 17:09
ReporterDenisChenuAssigned ToDenisChenu 
PrioritynoneSeverityminor 
Status resolvedResolutionfixed 
Product Version3.7.x 
Target VersionFixed in Version3.15.x 
Summary13630: EM send Notice about Undefined offset
Description

In some condition : EM send Undefined offset : 1

Steps To Reproduce

Import included survey
Set debug=2
Check logic

Additional Information

The strangest issue : why we don't have this issue before (2.73 have same issue) ?

Replace line by if (empty($errs[$errIndex++][1][1])) { send a Array to string conversion at $stringParts[] = "span title='".implode('; ', $messages)."' class='em-error'";

Then $messages are array of array ?

TagsNo tags attached.
Complete LimeSurvey version number (& build)3.7.0 git
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database & DB-Versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Activities

DenisChenu

DenisChenu

2018-04-24 12:07

developer  

limesurvey_survey_EMnotice.lss (18,329 bytes)
PHP notice.html (23,306 bytes)
PHP notice_survey.html (26,017 bytes)
DenisChenu

DenisChenu

2018-04-24 12:20

developer   ~47510

Have the fix but … unsure it's a real fix … em core are so … complicated …

LouisGac

LouisGac

2018-05-23 10:57

manager   ~47729

could be related to PHP 7 maybe?
https://stackoverflow.com/questions/42045336/php-7-1-empty-index-operator-array

PHP 7.1:
The empty index operator is not supported for strings anymore
Applying the empty index operator to a string (e.g. $str[] = $x) throws a fatal error instead of converting silently to array.

DenisChenu

DenisChenu

2018-06-11 11:04

developer   ~48039

Last edited: 2018-06-11 11:05

View 2 revisions

No, i'm on php 5.6 :) . and undefined offset is not related to PHP version.

Quick fix : if(empty($errs[$errIndex++][1][1])) : show better the issue, must be a string and it's an aray:

I think there are an issue about an array_merge VS array_push somewhere (real fix)

dominikvitt

dominikvitt

2018-06-12 18:31

developer   ~48069

It looks that Equation you wrote in 4th question isn't accepted by EM, probably IF part.
Are you sure that equation is correct?

DenisChenu

DenisChenu

2018-11-22 19:22

developer   ~49752

@dominikvitt : equation are not correct , just because using Inter and not INTER .

BUT : even with badly written equation : EM must show error and don't broke

Added another lss : ASSESSMENT_CURRENT_TOTAL issue



limesurvey_survey_ASSESSMENT_CURRENT_TOTAL.lss (17,805 bytes)
DenisChenu

DenisChenu

2018-11-23 09:20

developer   ~49754

https://github.com/LimeSurvey/LimeSurvey/pull/1180

Stil equation with error inside to test

DenisChenu

DenisChenu

2018-11-23 09:21

developer   ~49755

OK : current if an equation with error is used after : no error shown.
Fixed

DenisChenu

DenisChenu

2018-11-25 17:09

developer   ~49774

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

Related Changesets

LimeSurvey: master af310e8d

2018-11-25 17:09:14

DenisChenu


Committer: GitHub Details Diff
Fixed issue 13630: EM send Notice about Undefined offset

Dev: Pull request (#1180)
Dev: remove link on not valid variable (and qid is set here …)
Fixed issue : Only partial error shown in logic file
Dev: Previous system is totally broken , rewrite it
Dev: adding $this->RDP_errs inside $this->RDP_errs : remove this …
mod - application/config/version.php Diff File
mod - application/helpers/expressions/em_core_helper.php Diff File
mod - assets/scripts/admin/expression.js Diff File
mod - assets/styles-public/expressionlogicfile.css Diff File
mod - assets/styles-public/expressions.css Diff File

Issue History

Date Modified Username Field Change
2018-04-24 12:07 DenisChenu New Issue
2018-04-24 12:07 DenisChenu File Added: limesurvey_survey_EMnotice.lss
2018-04-24 12:07 DenisChenu File Added: PHP notice.html
2018-04-24 12:07 DenisChenu File Added: PHP notice_survey.html
2018-04-24 12:20 DenisChenu Note Added: 47510
2018-05-23 10:57 LouisGac Note Added: 47729
2018-06-11 10:38 LouisGac Assigned To => dominikvitt
2018-06-11 10:38 LouisGac Status new => assigned
2018-06-11 11:04 DenisChenu Note Added: 48039
2018-06-11 11:05 DenisChenu Note Edited: 48039 View Revisions
2018-06-12 18:31 dominikvitt Note Added: 48069
2018-11-22 19:22 DenisChenu File Added: limesurvey_survey_ASSESSMENT_CURRENT_TOTAL.lss
2018-11-22 19:22 DenisChenu Note Added: 49752
2018-11-23 01:40 DenisChenu Assigned To dominikvitt => DenisChenu
2018-11-23 09:20 DenisChenu Note Added: 49754
2018-11-23 09:21 DenisChenu Note Added: 49755
2018-11-25 17:09 DenisChenu Changeset attached => LimeSurvey master af310e8d
2018-11-25 17:09 DenisChenu Note Added: 49774
2018-11-25 17:09 DenisChenu Resolution open => fixed
2018-11-25 17:09 DenisChenu Status assigned => resolved
2018-11-25 17:09 DenisChenu Fixed in Version => 3.15.x