View Issue Details

This bug affects 1 person(s).
 0
IDProjectCategoryView StatusLast Update
09348Bug reportsSurvey editingpublic2014-11-07 15:25
Reportercnemmick Assigned Togabrieljenik  
PrioritynormalSeverityminor 
Status closedResolutionduplicate 
Product Version2.05+ 
Summary09348: PHP Notice when trying to using organizer to change question/group order
Description

When clicking on the question/group organizer (index.php/admin/survey/sa/organize/surveyid/11111), LS2 throws a PHP Notice: Undefined Index: surveyls_dateformat.

Code in /applications/helpers/expressions/em_manager_helper.php (line 3164) is causing the error by passing $LEM->surveyOptions, which is not populated with an array value for key "surveyls_dateformat". This causes function getDateFormatDataForQID (in /applications/helpers/surveytranslator_helper.php, line 798) to throw notice since key is undefined.

PHP Notice exception output screenshots:
https://dl.dropboxusercontent.com/u/1127998/undefined_index%201.png
https://dl.dropboxusercontent.com/u/1127998/undefined_index%202.png
https://dl.dropboxusercontent.com/u/1127998/undefined_index%203.png

Steps To Reproduce

Create a survey that has contains a Date/Time question that has both Minimum Date and Maximum Date values assigned. Then click on the organizer (Reorder question group/questions) button. PHP Notice will trigger.

See attached .lss file for sample survey.

Additional Information

Possible fix: replace line 3164 in /applications/helpers/expressions/em_manager_helper.php with the following:

$aDateFormatData=getDateFormatDataForQID($aAttributes[$questionNum],$LEM->sid);

Passing Survey ID to getDateFormatDataForQID() will load the proper date format data. A better solution may be ensuring that $LEM loads "surveyls_dateformat" from the survey settings properly.

I noticed other places where getDateFormatDataForQID() is passed $LEM->surveyOptions in the Lime2 codebase; may want to double-check those instances to make sure the proper values are assigned to $LEM->surveyOptions prior to the function call.

TagsNo tags attached.
Attached Files
Bug heat0
Complete LimeSurvey version number (& build)db19b551777d408f55694cb68dfb
I will donate to the project if issue is resolvedNo
BrowserAny
Database type & versionMySQL 5.5
Server OS (if known)Windows 2012 Server
Webserver software & version (if known)Apache/2.4.10 (Win32)
PHP VersionPHP 5.5.17

Relationships

duplicate of 09332 closedc_schmitz Date question + debug > 1 : broken Reorder survey 

Users monitoring this issue

There are no users monitoring this issue.

Activities

Issue History

Date Modified Username Field Change
2014-11-04 05:34 cnemmick New Issue
2014-11-04 05:34 cnemmick File Added: limesurvey_survey_126279.lss
2014-11-07 15:25 DenisChenu Relationship added duplicate of 09332
2014-11-07 15:25 DenisChenu Status new => closed
2014-11-07 15:25 DenisChenu Assigned To => gabrieljenik
2014-11-07 15:25 DenisChenu Resolution open => duplicate
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing