View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
06956Bug reportsCentral participant databasepublic2012-12-04 13:16
ReporterpfpDave Assigned Tomdekker  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Summary06956: Sorting Participant list only sorts visible entries
Description

When using the column headers to sort the list in the CPD, it ignores entries that are not currently displayed.

eg I have 100 entries in a list with surnames from A - Z, displayed are surnames N-X ... I click on the surname header to sort by surname, I only see entries N - X sorted in alphabetical order ... I expect to see A at the top of the list.

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)121121
I will donate to the project if issue is resolvedNo
BrowserIE8
Database type & versionSQL Express 2012
Server OS (if known)Server 2008
Webserver software & version (if known)IIS 7
PHP Version5.4.8

Relationships

related to 06454 closedmdekker Central Participant Database: Sorting of participants in grid is local only 

Users monitoring this issue

There are no users monitoring this issue.

Activities

mdekker

mdekker

2012-11-29 11:04

reporter   ~22673

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

mdekker

mdekker

2012-11-29 11:04

reporter   ~22674

Think I fixed sorting (and performance problems for non-superadmin users)

pfpDave

pfpDave

2012-11-29 11:29

reporter   ~22678

Almost perfect!

When trying to sort by Surveys column I get:


<h1>CDbException</h1>

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'survey'.. The SQL statement executed was: SELECT TOP 25 [p].*, [luser].[full_name] AS [ownername], [attribute1].[value] AS [a1], [attribute2].[value] AS [a2]
FROM [participants] [p]
left join users luser ON luser.uid=p.owner_uid
LEFT JOIN participant_attribute attribute1 ON attribute1.participant_id=p.participant_id AND attribute1.attribute_id=1
LEFT JOIN participant_attribute attribute2 ON attribute2.participant_id=p.participant_id AND attribute2.attribute_id=2
ORDER BY [survey] ASC (C:\limesurvey\framework\db\CDbCommand.php:528)

#0 C:\limesurvey\framework\db\CDbCommand.php(390): CDbCommand->queryInternal('fetchAll', Array, Array)
#1 C:\limesurvey\application\models\Participants.php(264): CDbCommand->queryAll()
#2 C:\limesurvey\application\controllers\admin\participantsaction.php(1035): Participants->getParticipants('1', '25', Array, 'survey asc', NULL)
#3 [internal function]: participantsaction->getParticipants_json()
#4 C:\limesurvey\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(participantsaction), Array)
#5 C:\limesurvey\application\core\Survey_Common_Action.php(82): CAction->runWithParamsInternal(Object(participantsaction), Object(ReflectionMethod), Array)
#6 C:\limesurvey\framework\web\CController.php(309): Survey_Common_Action->runWithParams(Array)
#7 C:\limesurvey\framework\web\CController.php(287): CController->runAction(Object(participantsaction))
#8 C:\limesurvey\framework\web\CController.php(266): CController->runActionWithFilters(Object(participantsaction), Array)
#9 C:\limesurvey\application\controllers\AdminController.php(159): CController->run('participants')
#10 C:\limesurvey\framework\web\CWebApplication.php(276): AdminController->run('participants')
#11 C:\limesurvey\framework\web\CWebApplication.php(135): CWebApplication->runController('admin/participa...')
#12 C:\limesurvey\framework\base\CApplication.php(162): CWebApplication->processRequest()
#13 C:\limesurvey\index.php(178): CApplication->run()
#14 {main}


And when trying to sort by custom attribute column 'Office', I get (also get a similar error when trying to sort by my other custom attribute column):

<h1>CDbException</h1>

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name '1'.. The SQL statement executed was: SELECT TOP 25 [p].*, [luser].[full_name] AS [ownername], [attribute1].[value] AS [a1], [attribute2].[value] AS [a2]
FROM [participants] [p]
left join users luser ON luser.uid=p.owner_uid
LEFT JOIN participant_attribute attribute1 ON attribute1.participant_id=p.participant_id AND attribute1.attribute_id=1
LEFT JOIN participant_attribute attribute2 ON attribute2.participant_id=p.participant_id AND attribute2.attribute_id=2
ORDER BY [1] ASC (C:\limesurvey\framework\db\CDbCommand.php:528)

#0 C:\limesurvey\framework\db\CDbCommand.php(390): CDbCommand->queryInternal('fetchAll', Array, Array)
#1 C:\limesurvey\application\models\Participants.php(264): CDbCommand->queryAll()
#2 C:\limesurvey\application\controllers\admin\participantsaction.php(1035): Participants->getParticipants('1', '25', Array, '1 asc', NULL)
#3 [internal function]: participantsaction->getParticipants_json()
#4 C:\limesurvey\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(participantsaction), Array)
#5 C:\limesurvey\application\core\Survey_Common_Action.php(82): CAction->runWithParamsInternal(Object(participantsaction), Object(ReflectionMethod), Array)
#6 C:\limesurvey\framework\web\CController.php(309): Survey_Common_Action->runWithParams(Array)
#7 C:\limesurvey\framework\web\CController.php(287): CController->runAction(Object(participantsaction))
#8 C:\limesurvey\framework\web\CController.php(266): CController->runActionWithFilters(Object(participantsaction), Array)
#9 C:\limesurvey\application\controllers\AdminController.php(159): CController->run('participants')
#10 C:\limesurvey\framework\web\CWebApplication.php(276): AdminController->run('participants')
#11 C:\limesurvey\framework\web\CWebApplication.php(135): CWebApplication->runController('admin/participa...')
#12 C:\limesurvey\framework\base\CApplication.php(162): CWebApplication->processRequest()
#13 C:\limesurvey\index.php(178): CApplication->run()
#14 {main}

mdekker

mdekker

2012-11-29 11:39

reporter   ~22679

Seems sql express is picky again ;-) I didn't get my test setup running using xampp and sqlexpress so i have to rely on you to test the mssql :/

The attributes fail for me too, the other probably need a table prefixed. If will do another commit shortly.

pfpDave

pfpDave

2012-11-29 11:43

reporter   ~22680

No Problem,

I've just had a look at the columns of the tables in the query and I can't find a survey column in my DB?

SELECT TOP 25 [p].*, [luser].[full_name] AS [ownername], [attribute1].[value] AS [a1], [attribute2].[value] AS [a2] FROM [participants] [p] left join users luser ON luser.uid=p.owner_uid LEFT JOIN participant_attribute attribute1 ON attribute1.participant_id=p.participant_id AND attribute1.attribute_id=1 LEFT JOIN participant_attribute attribute2 ON attribute2.participant_id=p.participant_id AND attribute2.attribute_id=2 ORDER BY [survey] ASC

mdekker

mdekker

2012-11-29 11:56

reporter   ~22681

Yeah found it, no mssql issue here didn't need the table prefix. Survey(count) is a calculated columnjust like language and ownername. Not sure if I can include it but will see what I can do. Will push a fix for the attributes first.

mdekker

mdekker

2012-11-29 12:01

reporter   ~22682

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

mdekker

mdekker

2012-11-29 12:04

reporter   ~22683

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

mdekker

mdekker

2012-11-29 12:04

reporter   ~22684

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

pfpDave

pfpDave

2012-11-29 12:12

reporter   ~22685

That seems to have sorted the custom attribute fields, thanks :)

pfpDave

pfpDave

2012-11-29 12:19

reporter   ~22686

Last edited: 2012-11-29 12:21

There seems to be a slight issue with overlap on pages however when sorting by custom attributes. I sorted by custom attribute department and the last two entries on the bottom of page 1 are on the top of Page 2 ... moving past page 2 isn't possible due to the pageing bug reported in a seperate log.

Edit : Paging bug only seems to happen now when sorted by a custom attribute - Great stuff!!!

pfpDave

pfpDave

2012-11-29 12:32

reporter   ~22689

I've also noticed another issue which I don't think was present before but may be unrelated ... tell me if you would rather I log a seperate bug?

When adding participants from a survey to the CPD it will only add 1000 even if more than this number are selected. eg I selected 1,984, selected all the entries and selected add participants to central database. The confirmation told me it had added 1,000 and when I checked, only 1,000 had been created in the CPD (Note duplicates did not already exist and this process was in Firefox).

mdekker

mdekker

2012-11-29 12:42

reporter   ~22690

I noticed that editing a participant doesn't work (anymore?). Do you know if it worked before? Before i push any other fixes I have ready, I will see if i can fix that.

Please open another issue for the adding participants, that way we don't loose track of it hidden inside the comments.

pfpDave

pfpDave

2012-11-29 12:43

reporter   ~22691

I'm not sure to be honest ... when I try editing I get the error 'CDbCommand failed to execute the SQL statement: SQLSTATE[07002]: ...'

I'll open another ticket for the other bug :)

mdekker

mdekker

2012-11-29 14:23

reporter   ~22703

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

mdekker

mdekker

2012-11-29 14:30

reporter   ~22704

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

mdekker

mdekker

2012-11-29 14:31

reporter   ~22705

Ok it took some iterations, but all fields should be sortable now and performance should be ok even with large numbers.

pfpDave

pfpDave

2012-11-29 14:40

reporter   ~22707

Sounds great, I'll try and make some time later this afternoon to test this and let you know.

mdekker

mdekker

2012-11-30 14:51

reporter   ~22736

Feel free to open a new bugreport after next release (probably tuesday) if issue is still around

pfpDave

pfpDave

2012-12-03 16:42

reporter   ~22825

I've now had time to test this and there seems to be another issue introduced by the fix (let me know if you'd rather I log a seperate bug report):

Add participants from the CPD to a survey with custom attributes and map these across, the following error is then displayed:

<h1>CDbException</h1>

CDbCommand failed to execute the SQL statement: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting the nvarchar value 'attribute_1' to data type int.. The SQL statement executed was: SELECT [value]
FROM [participant_attribute]
WHERE participant_id = :participant_id AND attribute_id = :attrid. Bound with participant_id='21706911-b4ab-4d69-a12e-6fd79adaa0eb', attrid='attribute_1' (C:\limesurvey_test\framework\db\CDbCommand.php:528)

#0 C:\limesurvey_test\framework\db\CDbCommand.php(408): CDbCommand->queryInternal('fetch', Array, Array)
#1 C:\limesurvey_test\application\models\Participants.php(924): CDbCommand->queryRow()
#2 C:\limesurvey_test\application\models\Participants.php(895): Participants->updateTokenAttributeValue('897685', '21706911-b4ab-4...', 'attribute_1', 17)
#3 C:\limesurvey_test\application\controllers\admin\participantsaction.php(1753): Participants->copytosurveyatt('897685', Array, Array, '21706911-b4ab-4...', 'false', 'false', 'false', 'true')
#4 [internal function]: participantsaction->addToTokenattmap()
#5 C:\limesurvey_test\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(participantsaction), Array)
#6 C:\limesurvey_test\application\core\Survey_Common_Action.php(82): CAction->runWithParamsInternal(Object(participantsaction), Object(ReflectionMethod), Array)
#7 C:\limesurvey_test\framework\web\CController.php(309): Survey_Common_Action->runWithParams(Array)
#8 C:\limesurvey_test\framework\web\CController.php(287): CController->runAction(Object(participantsaction))
#9 C:\limesurvey_test\framework\web\CController.php(266): CController->runActionWithFilters(Object(participantsaction), Array)
#10 C:\limesurvey_test\application\controllers\AdminController.php(159): CController->run('participants')
#11 C:\limesurvey_test\framework\web\CWebApplication.php(276): AdminController->run('participants')
#12 C:\limesurvey_test\framework\web\CWebApplication.php(135): CWebApplication->runController('admin/participa...')
#13 C:\limesurvey_test\framework\base\CApplication.php(162): CWebApplication->processRequest()
#14 C:\limesurvey_test\index.php(178): CApplication->run()
#15 {main}

pfpDave

pfpDave

2012-12-03 16:43

reporter   ~22826

Last edited: 2012-12-03 16:44

Also not sure if you're expecting to see the editing bug fixed, gives the error below for me:

CDbCommand failed to execute the SQL statement: SQLSTATE[07002]: [Microsoft][SQL Server Native Client 11.0]COUNT field incorrect or syntax error. The SQL statement executed was: UPDATE [participants] SET [participant_id]=:participant_id, [firstname]=:firstname, [lastname]=:lastname, [email]=:email, [language]=:language, [blacklisted]=:blacklisted, [owner_uid]=:owner_uid WHERE participant_id = :participant_id. Bound with :participant_id='8f4a509c-f377-4970-aacc-c00a407cb587', :firstname='Fred', :lastname='Smith-test', :email='fred.smith@email.com', :language='en', :blacklisted='N', :owner_uid=1 (C:\limesurvey_test\framework\db\CDbCommand.php:354)

mdekker

mdekker

2012-12-03 20:29

reporter   ~22832

With this last commit all seems to be working for me. Could you please wait for the new release (tomorrow) and then open a new bugreport if you still have issues? Thank you!

pfpDave

pfpDave

2012-12-04 12:23

reporter   ~22841

No problem at all, I'll grab the latest release when it's published and test all my outstanding issues then.

Dave

c_schmitz

c_schmitz

2012-12-04 13:16

administrator   ~22842

LimeSurvey 2.0+ build 121204 released.

Related Changesets

LimeSurvey: master 0ac69fba

2012-11-29 11:03

mdekker


Details Diff
Fixed 06956: Sorting Participant list only sorts visible entries Affected Issues
06956
mod - application/controllers/admin/participantsaction.php Diff File
mod - application/models/Participants.php Diff File
mod - scripts/admin/displayParticipant.js Diff File

LimeSurvey: 2.1 abeac7b5

2012-11-29 11:03

mdekker


Details Diff
Fixed 06956: Sorting Participant list only sorts visible entries Affected Issues
06956
mod - application/controllers/admin/participantsaction.php Diff File
mod - application/models/Participants.php Diff File
mod - scripts/admin/displayParticipant.js Diff File

LimeSurvey: master 4c598fb7

2012-11-29 12:02

mdekker


Details Diff
Fixed 06956: Sorting Participant list only sorts visible entries
dev: attributes can now be used for sort, to do: surveys, language and owner name
Affected Issues
06956
mod - application/views/admin/participants/displayParticipants_view.php Diff File

LimeSurvey: 2.1 0966f259

2012-11-29 12:03

mdekker


Details Diff
Fixed 06956: Sorting Participant list only sorts visible entries
dev: attributes can now be used for sort, to do: surveys, language and owner name
Affected Issues
06956
mod - application/views/admin/participants/displayParticipants_view.php Diff File

LimeSurvey: master 05ce55f6

2012-11-29 12:56

mdekker


Details Diff
dev: Restored inline edit + fixed pagination and disabled sort on survey(count) for now Affected Issues
06956
mod - application/controllers/admin/participantsaction.php Diff File
mod - application/models/Participants.php Diff File

LimeSurvey: 2.1 e93ece7c

2012-11-29 12:57

mdekker


Details Diff
dev: Restored inline edit + fixed pagination and disabled sort on survey(count) for now Affected Issues
06956
mod - application/controllers/admin/participantsaction.php Diff File
mod - application/models/Participants.php Diff File

LimeSurvey: master 33b2d551

2012-11-29 14:23

mdekker


Details Diff
Fixed 06956: Sorting Participant list only sorts visible entries
dev: all fields, including survey(count) should work now
Affected Issues
06956
mod - application/controllers/admin/participantsaction.php Diff File
mod - application/models/Participants.php Diff File

LimeSurvey: 2.1 fef75cbf

2012-11-29 14:24

mdekker


Details Diff
Fixed 06956: Sorting Participant list only sorts visible entries
dev: all fields, including survey(count) should work now
Affected Issues
06956
mod - application/controllers/admin/participantsaction.php Diff File
mod - application/models/Participants.php Diff File

LimeSurvey: master f0de4338

2012-12-03 20:26

mdekker


Details Diff
dev: some final mssql compatibility fixes for participant panel Affected Issues
06956
mod - application/controllers/admin/participantsaction.php Diff File
mod - application/models/Participants.php Diff File

Issue History

Date Modified Username Field Change
2012-11-26 13:45 pfpDave New Issue
2012-11-26 13:45 pfpDave Status new => assigned
2012-11-26 13:45 pfpDave Assigned To => jcleeland
2012-11-29 11:04 mdekker Changeset attached => LimeSurvey master 0ac69fba
2012-11-29 11:04 mdekker Note Added: 22673
2012-11-29 11:04 mdekker Assigned To jcleeland => mdekker
2012-11-29 11:04 mdekker Resolution open => fixed
2012-11-29 11:04 mdekker Note Added: 22674
2012-11-29 11:29 pfpDave Note Added: 22678
2012-11-29 11:39 mdekker Note Added: 22679
2012-11-29 11:43 pfpDave Note Added: 22680
2012-11-29 11:56 mdekker Note Added: 22681
2012-11-29 12:01 mdekker Changeset attached => LimeSurvey 2.1 abeac7b5
2012-11-29 12:01 mdekker Note Added: 22682
2012-11-29 12:04 mdekker Changeset attached => LimeSurvey master 4c598fb7
2012-11-29 12:04 mdekker Note Added: 22683
2012-11-29 12:04 mdekker Changeset attached => LimeSurvey 2.1 0966f259
2012-11-29 12:04 mdekker Note Added: 22684
2012-11-29 12:12 pfpDave Note Added: 22685
2012-11-29 12:19 pfpDave Note Added: 22686
2012-11-29 12:21 pfpDave Note Edited: 22686
2012-11-29 12:32 pfpDave Note Added: 22689
2012-11-29 12:42 mdekker Note Added: 22690
2012-11-29 12:43 pfpDave Note Added: 22691
2012-11-29 14:23 mdekker Changeset attached => LimeSurvey master 33b2d551
2012-11-29 14:23 mdekker Note Added: 22703
2012-11-29 14:30 mdekker Changeset attached => LimeSurvey 2.1 fef75cbf
2012-11-29 14:30 mdekker Note Added: 22704
2012-11-29 14:31 mdekker Note Added: 22705
2012-11-29 14:32 mdekker Changeset attached => LimeSurvey master 05ce55f6
2012-11-29 14:32 mdekker Changeset attached => LimeSurvey 2.1 e93ece7c
2012-11-29 14:40 pfpDave Note Added: 22707
2012-11-30 09:12 mdekker Relationship added related to 06454
2012-11-30 14:51 mdekker Note Added: 22736
2012-11-30 14:51 mdekker Status assigned => resolved
2012-11-30 14:51 mdekker Fixed in Version => 2.10
2012-12-03 16:42 pfpDave Note Added: 22825
2012-12-03 16:43 pfpDave Note Added: 22826
2012-12-03 16:43 pfpDave Note Edited: 22826
2012-12-03 16:44 pfpDave Note Edited: 22826
2012-12-03 20:28 mdekker Changeset attached => LimeSurvey master f0de4338
2012-12-03 20:29 mdekker Note Added: 22832
2012-12-04 12:23 pfpDave Note Added: 22841
2012-12-04 13:16 c_schmitz Note Added: 22842
2012-12-04 13:16 c_schmitz Status resolved => closed