View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
07177Bug reportsCentral participant databasepublic2013-03-05 08:45
ReporterpfpDave Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary07177: Search on custom attribute field doesn't work where value is a number
Description

I have a custom attribute field in my CPD which contains fully numeric and mixed text and numeric values, when searching for a numeric value (eg 12345) I get the error below, searching for a value beginning with a character works ok:

<h1>CDbException</h1>
<p>CDbCommand failed to execute the SQL statement: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting the varchar value 'T00499' to data type int.. The SQL statement executed was: SELECT count(*) as cnt
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
LEFT JOIN participant_attribute attribute4 ON attribute4.participant_id=p.participant_id AND attribute4.attribute_id=4
WHERE (attribute4.value = :condition_0) (C:\limesurvey\framework\db\CDbCommand.php:528)</p><pre>#0 C:\limesurvey\framework\db\CDbCommand.php(425): CDbCommand->queryInternal('fetchColumn', 0, Array)
#1 C:\limesurvey\application\models\Participants.php(259): CDbCommand->queryScalar()
#2 C:\limesurvey\application\controllers\admin\participantsaction.php(815): Participants->getParticipantsCount(Array, Object(CDbCriteria), NULL)
#3 C:\limesurvey\application\controllers\admin\participantsaction.php(782): participantsaction->getParticipants_json(Object(CDbCriteria))
#4 [internal function]: participantsaction->getParticipantsResults_json()
#5 C:\limesurvey\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(participantsaction), Array)
#6 C:\limesurvey\application\core\Survey_Common_Action.php(100): CAction->runWithParamsInternal(Object(participantsaction), Object(ReflectionMethod), Array)
#7 C:\limesurvey\application\controllers\admin\participantsaction.php(51): Survey_Common_Action->runWithParams(Array)
#8 C:\limesurvey\framework\web\CController.php(309): participantsaction->runWithParams(Array)
#9 C:\limesurvey\framework\web\CController.php(287): CController->runAction(Object(participantsaction))
#10 C:\limesurvey\framework\web\CController.php(266): CController->runActionWithFilters(Object(participantsaction), Array)
#11 C:\limesurvey\application\controllers\AdminController.php(169): CController->run('participants')
#12 C:\limesurvey\framework\web\CWebApplication.php(276): AdminController->run('participants')
#13 C:\limesurvey\framework\web\CWebApplication.php(135): CWebApplication->runController('admin/participa...')
#14 C:\limesurvey\framework\base\CApplication.php(162): CWebApplication->processRequest()
#15 C:\limesurvey\index.php(178): CApplication->run()
#16 {main}</pre>

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)130108
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

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2013-02-19 15:20

administrator   ~24175

pfpDave, I cannot reproduce this anymore on the latest version. Can you please check and tell me if you still have the problem?

c_schmitz

c_schmitz

2013-03-01 15:53

administrator   ~24451

Pretty please?

pfpDave

pfpDave

2013-03-04 12:06

reporter   ~24509

Just tested on 130226 and here's how I got on:

  • Blank CPD

  • Add three custom attribute fields:

    1. Office
    2. Department
    3. Username
  • Add two tokens manually using controls on this page:

    1. First Name: test Last Name: user1 E-mail: test@local.com
    2. First Name: test Last Name: user2 E-mail: test@local.com
  • Edit custom attribute USERNAME as follows:

    1. (test user1) : 123
    2. (test user2) : t123

Click Search and enter criteria:
Username equals t123

  • Result: Search executes as expected

Click Search and enter criteria:
Username equals 123

  • Result: Search returns error
c_schmitz

c_schmitz

2013-03-04 21:21

administrator   ~24515

Thank you!

c_schmitz

c_schmitz

2013-03-04 21:23

administrator   ~24516

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

c_schmitz

c_schmitz

2013-03-05 08:45

administrator   ~24525

2.00+ Build 130305 released.

Related Changesets

LimeSurvey: master d5dc6b8b

2013-03-04 20:23:10

c_schmitz

Details Diff
Fixed issue 07177: Search on custom attribute field doesn't work if searched text is a number Affected Issues
07177
mod - application/models/Participants.php Diff File

Issue History

Date Modified Username Field Change
2013-01-10 17:28 pfpDave New Issue
2013-01-10 17:28 pfpDave Status new => assigned
2013-01-10 17:28 pfpDave Assigned To => jcleeland
2013-02-19 15:20 c_schmitz Note Added: 24175
2013-02-19 15:20 c_schmitz Assigned To jcleeland => c_schmitz
2013-02-19 15:20 c_schmitz Status assigned => feedback
2013-03-01 15:53 c_schmitz Note Added: 24451
2013-03-04 12:06 pfpDave Note Added: 24509
2013-03-04 12:06 pfpDave Status feedback => assigned
2013-03-04 21:21 c_schmitz Note Added: 24515
2013-03-04 21:21 c_schmitz Status assigned => resolved
2013-03-04 21:21 c_schmitz Fixed in Version => 2.00+
2013-03-04 21:21 c_schmitz Resolution open => fixed
2013-03-04 21:23 c_schmitz Changeset attached => LimeSurvey master d5dc6b8b
2013-03-04 21:23 c_schmitz Note Added: 24516
2013-03-05 08:45 c_schmitz Note Added: 24525
2013-03-05 08:45 c_schmitz Status resolved => closed