View Issue Details

IDProjectCategoryView StatusLast Update
13677Bug reports[All Projects] Survey designpublic2018-05-23 10:38
ReporterwehrAssigned Todominikvitt 
Status assignedResolutionopen 
Product Version3.7.x 
Target VersionFixed in Version 
Summary13677: Sorting of groups and questions are wrong (with fix)

Currently the ordering of question groups and questions in the survey list (question explorer) and the final survey itself is wrong.

Steps To ReproduceCreate 3x Groups and in every Group 3x questions.
You will get:
Group 2 (order index 1)
 Q2 (order index 1)
 Q3 (order index 2)
 Q1 (order index 0)
Group 3 (order index 2)
 Q2 (order index 1)
 Q3 (order index 2)
 Q1 (order index 0)
Group 1 (order index 0)
 Q2 (order index 1)
 Q3 (order index 2)
 Q1 (order index 0)

You can see that the first group with order index 0 is sorted as last and every question with order index 0 in the corresponding group is also sorted as last item.

Additional InformationHow to fix it:
In _questionsgroups.vue / lsadminpanel.js
#31 and #88
the problem is the orderBy() call.
 return parseInt(a.group_order || 999999)
  return parseInt(a.question_order || 999999);
in case of "order" == 0 the "||" uses 99999 because 0 can be converted to false.
A fix would be to throw-away the "|| 999999" part" ?
TagsNo tags attached.
Complete LimeSurvey version number (& build)3.7.2 github master
I will donate to the project if issue is resolvedNo
BrowserFirefox 60, Chrome 66
Database & DB-VersionPostgreSQL 10.4
Operating System (Server)Linux Debian Stretch
Webserver software & versionApache/2.4.25 (Debian)
PHP Version 7.2.5




2018-05-18 10:07

developer   ~47675

Thanks for reporting it and find the issue.
Maybe you can put a pull request ?


2018-05-18 20:01

reporter   ~47690

Sure no problem.
Should I push the proposed fix with stripping the "|| 999999" part?


2018-05-19 11:02

developer   ~47694

Yes, i didn't see issue to strip this part :) (but i can make error like all dev). Thank you :)

Issue History

Date Modified Username Field Change
2018-05-16 13:04 wehr New Issue
2018-05-18 10:07 DenisChenu Note Added: 47675
2018-05-18 20:01 wehr Note Added: 47690
2018-05-19 11:02 DenisChenu Note Added: 47694
2018-05-23 10:38 LouisGac Assigned To => dominikvitt
2018-05-23 10:38 LouisGac Status new => assigned