View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
08598Bug reportsSurvey editingpublic2014-02-04 13:32
Reporterpmonstad Assigned Totpartner  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary08598: incorrect alphabetically sort of surveys in list
Description

The survey list is not correctly sorted (alphabetically) when hitting the header in survey list. See screenshot: http://awesomescreenshot.com/0be2986k8a

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)140125
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionall
Server OS (if known)all
Webserver software & version (if known)all
PHP Versionall

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2014-01-25 18:49

administrator   ~28177

Looks like the survey column still sorts after SID.

tpartner

tpartner

2014-01-25 19:43

partner   ~28185

It's actually sorting on SID and Survey combined...

tpartner

tpartner

2014-01-26 14:31

partner   ~28197

I don't see anything amiss with the JavaScript. The colModel (which would be the most likely offender) appears to be correct.

Also I find that, when loaded, the table is not being sorted by SID as it should be. (although the sortname and sortorder options appear to be correct)

Could it be a problem with the JSONized grid data? (dunno if it helps but this data is also not sorted)

c_schmitz

c_schmitz

2014-01-26 15:06

administrator   ~28200

Maybe a bug in jqGrid? It should not matter how the grid data is sorted as the JS takes care of it?

tpartner

tpartner

2014-01-27 17:24

partner   ~28229

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

tpartner

tpartner

2014-01-27 17:25

partner   ~28230

Well, dunno whether it's really a jqGrid bug but the sort function is including the anchor tags in those cells. Therefor it's effectively sorting by a combination of survey ID and name.

I have added a custom sorting function to strip the <a> tag before sorting.

This still does not solve the non sorting by ID on page load...

tpartner

tpartner

2014-01-27 17:46

partner   ~28231

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

tpartner

tpartner

2014-01-27 17:47

partner   ~28232

It seems that the JSON data should be sorted - http://www.trirand.com/blog/?page_id=393/help/how-to-do-default-sorting-when-grid-first-time-load/

I have incorporated the fix from that post but it would be preferable to sort before delivery.

Thoughts?

DenisChenu

DenisChenu

2014-01-27 17:53

developer   ~28233

It's my fault here ....

Didn't understand why there are a comment before the link ...
https://github.com/LimeSurvey/LimeSurvey/commit/f188b85d567ae2e3730c15a968d5d4598bb265ab#diff-ae6ef646cdcd6b65eca67ba2a3b15a27L626

Then removing it.

Still the main issue is getsurveyJson need to return text only and not HTML. Started a fix, but no time to accomplish.

The alternative here is to remove the link, and do it in JavaScript only.

tpartner

tpartner

2014-01-27 18:12

partner   ~28234

Okay, now I get what changed to break the sorting by "Survey" :)

Should we put the comment back in or just leave it with the new sorttype function?

tpartner

tpartner

2014-01-27 18:33

partner   ~28236

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

tpartner

tpartner

2014-01-27 20:47

partner   ~28238

Denis, if we want to remove the link(s) from getSurveys_json(), we can use a custom jqGrid formatter - http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter

Something like this:
function surveyColumnFormatter (cellvalue, options, rowObject) {
return 'view/surveyid/' + options.rowId + '';
}

My concerns with that are:

1) How to pass translations in the link(s) - for title, etc
2) Where else is getSurveys_json() used?

DenisChenu

DenisChenu

2014-01-28 08:51

developer   ~28242

Hi tpartner, i start to work on this, but need more than just this column here.

For this one : We just need to do a link to survey. Then i think we can "just" do a link with sid and text.

Something like that:
gridComplete: function(data){
updateCells();
},

function updateCells(){
$("#displaysurveys tbody tr").each(function(){
$(this).find("td:eq(4)").html(".calculatedSurveyLink."); // QUickliy done, surely broken

});
}

But in this function we need:

  • Update the first column (get state and replace with piture according to state)
  • Update survey name column
  • Update the owner column

For survey name and owner : maybe we can use something like:
$(document).on("click","#displaysurveys tbody tr ts:eq(4)",finction(){
});
Think it's better, but need too a some time to work on it.

The quicly is to add again the <!-- surveyname -->

Just remind to purify surveyname

tpartner

tpartner

2014-01-28 11:41

partner   ~28251

Okay, over to you - I think you may be over-complicating it.

DenisChenu

DenisChenu

2014-01-28 11:53

developer   ~28252

It's great now ?

I think of a devloppment bug (for 2.1/2.2/2.3), not a 'bug report' bug.

Sorry,

You made it now ?

tpartner

tpartner

2014-01-28 12:00

partner   ~28253

It is now working as expected:

  • On load, the table is sorted by ID
  • Sorting by "Survey" now works correctly
DenisChenu

DenisChenu

2014-01-28 12:56

developer   ~28255

Move to jqgrid/autoencode;true is not this bug ;)

Thanks Tony

c_schmitz

c_schmitz

2014-01-31 17:32

administrator   ~28345

LimeSurvey 2-05+ Build 140131 released

pmonstad

pmonstad

2014-01-31 17:49

updater   ~28360

The sort of survey name is still a little odd as it differs between upper and lower case letters. Uppercae names are sorted before lowercase, making the list show like e.g. this:

My survey
a survey example

The sorting routine should be case insensitive. Make no sense elsewhere.

tpartner

tpartner

2014-01-31 19:53

partner   ~28361

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

tpartner

tpartner

2014-01-31 19:54

partner   ~28362

That seems to be a jqGrid bug - the "ignoreCase" option is set to true. However, I have put in a workaround.

c_schmitz

c_schmitz

2014-02-04 13:32

administrator   ~28515

Version 2.05+ Build 140204 released

Related Changesets

LimeSurvey: master 20e1951a

2014-01-27 16:24:31

tpartner

Details Diff
Fixed issue 08598: incorrect alphabetically sort of surveys in list
Dev Added custom sorttype function for the "Survey" column
Dev This function strips the anchor tag before sorting
Affected Issues
08598
mod - application/views/admin/survey/listSurveys_view.php Diff File

LimeSurvey: master e41668d4

2014-01-27 16:46:35

tpartner

Details Diff
Fixed issue 08598: incorrect alphabetically sort of surveys in list
Dev Reload the grid to sort by ID
Affected Issues
08598
mod - scripts/admin/listsurvey.js Diff File

LimeSurvey: master 6be6b5bb

2014-01-27 17:33:28

tpartner

Details Diff
Fixed issue 08598: incorrect alphabetically sort of surveys in list
Dev Prevent the "flash" when the grid is reloaded after correctly sorting
Affected Issues
08598
mod - scripts/admin/listsurvey.js Diff File

LimeSurvey: master 6018bde1

2014-01-31 18:53:00

tpartner

Details Diff
Fixed issue 08598: incorrect alphabetically sort of surveys in list
Dev Workaround for case-insesitive sorting of "Survey" column
Affected Issues
08598
mod - application/views/admin/survey/listSurveys_view.php Diff File

Issue History

Date Modified Username Field Change
2014-01-25 16:48 pmonstad New Issue
2014-01-25 18:49 c_schmitz Assigned To => tpartner
2014-01-25 18:49 c_schmitz Status new => assigned
2014-01-25 18:49 c_schmitz Note Added: 28177
2014-01-25 19:43 tpartner Note Added: 28185
2014-01-26 14:31 tpartner Note Added: 28197
2014-01-26 14:31 tpartner Assigned To tpartner =>
2014-01-26 14:31 tpartner Assigned To => c_schmitz
2014-01-26 15:06 c_schmitz Note Added: 28200
2014-01-27 17:24 tpartner Changeset attached => LimeSurvey master 20e1951a
2014-01-27 17:24 tpartner Note Added: 28229
2014-01-27 17:24 tpartner Assigned To c_schmitz => tpartner
2014-01-27 17:24 tpartner Resolution open => fixed
2014-01-27 17:25 tpartner Note Added: 28230
2014-01-27 17:46 tpartner Changeset attached => LimeSurvey master e41668d4
2014-01-27 17:46 tpartner Note Added: 28231
2014-01-27 17:47 tpartner Note Added: 28232
2014-01-27 17:53 DenisChenu Note Added: 28233
2014-01-27 18:12 tpartner Note Added: 28234
2014-01-27 18:33 tpartner Changeset attached => LimeSurvey master 6be6b5bb
2014-01-27 18:33 tpartner Note Added: 28236
2014-01-27 20:47 tpartner Note Added: 28238
2014-01-28 08:51 DenisChenu Note Added: 28242
2014-01-28 11:41 tpartner Note Added: 28251
2014-01-28 11:41 tpartner Assigned To tpartner =>
2014-01-28 11:41 tpartner Assigned To => DenisChenu
2014-01-28 11:53 DenisChenu Note Added: 28252
2014-01-28 12:00 tpartner Note Added: 28253
2014-01-28 12:56 DenisChenu Note Added: 28255
2014-01-28 12:56 DenisChenu Status assigned => resolved
2014-01-28 12:56 DenisChenu Fixed in Version => 2.05+
2014-01-28 12:56 DenisChenu Assigned To DenisChenu => tpartner
2014-01-31 17:32 c_schmitz Note Added: 28345
2014-01-31 17:32 c_schmitz Status resolved => closed
2014-01-31 17:49 pmonstad Note Added: 28360
2014-01-31 17:49 pmonstad Status closed => feedback
2014-01-31 17:49 pmonstad Resolution fixed => reopened
2014-01-31 19:53 tpartner Changeset attached => LimeSurvey master 6018bde1
2014-01-31 19:53 tpartner Note Added: 28361
2014-01-31 19:54 tpartner Note Added: 28362
2014-01-31 19:54 tpartner Status feedback => resolved
2014-01-31 19:54 tpartner Resolution reopened => fixed
2014-02-04 13:32 c_schmitz Note Added: 28515
2014-02-04 13:32 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing