View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
10340Bug reportsOtherpublic2016-02-10 21:03
Reportersickpig Assigned ToLouisGac 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.50.x 
Summary10340: Search on "Survey list page" does not work
Description

Search on "Survey list page" does not work. In fact it rasie an internal server error.

Steps To Reproduce

0) login into limesurvey admin page
1) got to "Survey list"
2) Use the search function
3) you'll get this DB error (see attached img):

Internal Server Error

CDbCommand failed to execute the SQL statement: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: integer ~~ unknown
LINE 1: ...agesettings.surveyls_title LIKE '%12%') OR (t.sid LIKE '%12%...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

Additional Information

In my opinioni the problem is that in the SQL statement LIKE operator is used against a integer field. It could be postgres specific, may it works on mysql. But I bet that also mssql could complains about it.

TagsNo tags attached.
Attached Files
sql-error.png (66,203 bytes)   
sql-error.png (66,203 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)Build 160206
I will donate to the project if issue is resolvedNo
Browserchrome v48
Database type & versionPostgreSQL v9.1+
Server OS (if known)Linux Ubuntu 14.04
Webserver software & version (if known)Apache and Nginx
PHP Version5.5.9

Users monitoring this issue

There are no users monitoring this issue.

Activities

LouisGac

LouisGac

2016-02-08 19:42

developer   ~34742

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

sickpig

sickpig

2016-02-09 14:19

reporter   ~34794

Thanks for the fix.

One last thing. If performing the search by sid is considered important why not just special casing 'pgsql' installations with something like that:

$sid_reference = (Yii::app()->db->getDriverName() == 'pgsql' ?' t.sid::varchar' : 't.sid');
$criteria->compare($sid_reference, $this->searched_value, true, 'OR');

that will make it work on pgsql and even on mysql (tested). I do not have access to mssql bu I do think that we can deal with any special also for it.

I know that code is a hack nonetheless functional.

sickpig

sickpig

2016-02-10 13:48

reporter   ~34821

Added a PR against master branch:

https://github.com/LimeSurvey/LimeSurvey/pull/437

c_schmitz

c_schmitz

2016-02-10 21:03

administrator   ~34859

2.5 Build 160210 released

Related Changesets

LimeSurvey: master d47a20fd

2016-02-08 19:42

LouisGac


Details Diff
Fixed issue 10340: remove search on SID to satisfy postgresql Affected Issues
10340
mod - application/models/Survey.php Diff File

Issue History

Date Modified Username Field Change
2016-02-08 09:49 sickpig New Issue
2016-02-08 09:49 sickpig File Added: sql-error.png
2016-02-08 15:16 ollehar Assigned To => LouisGac
2016-02-08 15:16 ollehar Status new => assigned
2016-02-08 19:42 LouisGac Changeset attached => LimeSurvey master d47a20fd
2016-02-08 19:42 LouisGac Note Added: 34742
2016-02-08 19:42 LouisGac Resolution open => fixed
2016-02-08 19:42 LouisGac Status assigned => resolved
2016-02-09 14:19 sickpig Note Added: 34794
2016-02-10 13:48 sickpig Note Added: 34821
2016-02-10 21:03 c_schmitz Note Added: 34859
2016-02-10 21:03 c_schmitz Status resolved => closed