View Issue Details

IDProjectCategoryView StatusLast Update
13677Bug reports[All Projects] Survey designpublic2018-08-07 17:01
ReporterwehrAssigned Tomarkusfluer 
PrioritynoneSeveritymajor 
Status closedResolutionfixed 
Product Version3.7.x 
Target VersionFixed in Version3.13.x 
Summary13677: Sorting of groups and questions are wrong (with fix)
DescriptionHi,

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

regards,
Mario
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)
and
  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

Relationships

has duplicate 13851 closedmarkusfluer Disorder of Survey structure 
has duplicate 13729 closedmarkusfluer Question group order incorrect 

Activities

DenisChenu

DenisChenu

2018-05-18 10:07

developer   ~47675

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

wehr

2018-05-18 20:01

reporter   ~47690

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

DenisChenu

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 :)
markusfluer

markusfluer

2018-07-12 11:54

manager   ~48497

Completely ignoring the fallback is not the right solution imho, but you are right it should be strictly checking for non integer values.
If you like you can do a pull request, but we can also fix it.
markusfluer

markusfluer

2018-08-07 17:01

manager   ~48682

Release 3.14.2+180807

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
2018-05-31 14:29 dominikvitt Assigned To dominikvitt => markusfluer
2018-07-12 11:54 markusfluer Note Added: 48497
2018-07-12 11:54 markusfluer Relationship added has duplicate 13851
2018-07-12 12:01 markusfluer Relationship added has duplicate 13729
2018-08-06 17:13 markusfluer Status assigned => resolved
2018-08-06 17:13 markusfluer Resolution open => fixed
2018-08-06 17:13 markusfluer Fixed in Version => 3.13.x
2018-08-07 17:01 markusfluer Status resolved => closed
2018-08-07 17:01 markusfluer Note Added: 48682