View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
18550Bug reportsResponse browsingpublic2024-08-06 16:55
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.28.x 
Summary18550: MSSQL Reponse filter with underscore or bracket not working
Description

When have response with underscore (_) or backet like [ or ] : filtering does not give any results.

Steps To Reproduce

Steps to reproduce

Have a MSSQL (and another DB to compare)
Import included survey
Go to browse response
Try filtering TEXT by _
Try filtering TEXT by check[bracket]

Expected result

Have some value in response

Actual result

Empty result

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)5.4.14
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionSQLServer (MS) 15.00.4261
Server OS (if known)windows
Webserver software & version (if known)https://github.com/LimeSurvey/LimeSurvey/pull/3900
PHP VersionPHP7.4

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-12-12 18:58

developer   ~73068

See Yii 2

https://github.com/yiisoft/yii2/blob/3ad01aa0f04b26313c28811b9e1f052cbb19b6f7/framework/db/mssql/conditions/LikeConditionBuilder.php#L18

Against Yii1

https://github.com/yiisoft/yii/blob/8530c30959d5f68c0d1b0d611e3ce2bf32a8371a/framework/db/schema/CDbCriteria.php#L259

DenisChenu

DenisChenu

2022-12-12 19:02

developer   ~73069

Last edited: 2022-12-12 19:06

Own fix here :
https://gitlab.com/SondagesPro/QuestionSettingsType/SelectQuestionByResponses/-/blob/main/SelectQuestionByResponses.php#L747

http://burnignorance.com/database-tips-and-tricks/how-to-escape-wildcard-characters-while-searching-in-sql-server/
https://www.howtogeek.com/howto/the-geek-blog/search-for-rows-with-special-characters-in-sql-server/

DenisChenu

DenisChenu

2023-01-21 13:48

developer   ~73521

No way to extend CBDCriteria or replace CBDCriteria ???
Arg …

https://github.com/yiisoft/yii/issues/4512

DenisChenu

DenisChenu

2023-05-04 16:34

developer   ~74817

@ollehar : the only way to fix it seems to fix manually Yii1 …

See https://github.com/yiisoft/yii/issues/4512#issuecomment-1400704265

We close as «Not fixable» an i create a Fork for MSSQL ?
Or we apply a fix to Yii1 ?

DenisChenu

DenisChenu

2023-05-04 16:35

developer   ~74818

Last edited: 2023-05-04 16:36

Did i take time to fix it in LimeSurey core
Or i fix it in a fork Shnoulle/LimsurveySQL (more quick … )

ollehar

ollehar

2023-05-05 11:46

administrator   ~74831

Urgh. Not sure.

ollehar

ollehar

2023-05-05 11:47

administrator   ~74832

Last edited: 2023-05-05 11:47

Is this fixed in Yii 3 query builder or active record package, I wonder...

DenisChenu

DenisChenu

2023-05-05 11:50

developer   ~74833

Me too … i think i create a fork for one of my client, updating directly Yii

But : if i do it for LS :

  1. Create a LSCDbCriteria extends CDbCriteria
  2. replace addSearchCondition function : if escape and MSSQL : set escape as false and do own replacement
  3. Call parent
  4. Replace ALL CDbCriteria i found by LSCDbCriteria

Tell me :)

DenisChenu

DenisChenu

2023-05-05 11:51

developer   ~74834

Last edited: 2023-05-05 11:51

Is this fixed in Yii 3 query builder or active record package, I wonder...

Fixed in Yii2, then Yii3 too.

ollehar

ollehar

2023-05-05 12:01

administrator   ~74835

OK, so since master now require PHP 7.4 at least, it's actually possible for us to start to use Yii 3 packages step by step. Dunno if that would work here tho.

DenisChenu

DenisChenu

2023-05-05 15:32

developer   ~74843

OK, so since master now require PHP 7.4 at least, it's actually possible for us to start to use Yii 3 packages step by step. Dunno if that would work here tho.

take a lot more time , i do my fork :)
(and i need a LS3 fork too)

DenisChenu

DenisChenu

2023-07-27 15:29

developer   ~76303

Can be incluided in https://github.com/LimeSurvey/LimeSurvey/blob/master/application/core/LSDbCriteria.php

DenisChenu

DenisChenu

2024-06-29 10:04

developer   ~80498

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

DenisChenu

DenisChenu

2024-08-06 14:34

developer   ~80748

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

LimeBot

LimeBot

2024-08-06 16:55

administrator   ~80755

Fixed in Release 6.6.1+240806

Related Changesets

LimeSurvey: master 23520134

2024-08-06 16:18

DenisChenu

Committer: GitHub


Details Diff
Fixed issue 18550: MSSQL Reponse filter with underscore or bracket not working (03900) Affected Issues
18550
mod - application/core/LSDbCriteria.php Diff File
mod - application/models/Assessment.php Diff File
mod - application/models/LabelSet.php Diff File
mod - application/models/Participant.php Diff File
mod - application/models/ParticipantAttributeName.php Diff File
mod - application/models/Question.php Diff File
mod - application/models/QuestionGroup.php Diff File
mod - application/models/QuestionTheme.php Diff File
mod - application/models/SurveymenuEntries.php Diff File
mod - application/models/SurveysGroups.php Diff File
mod - application/models/Template.php Diff File
mod - application/models/TemplateConfiguration.php Diff File

Issue History

Date Modified Username Field Change
2022-12-12 18:44 DenisChenu New Issue
2022-12-12 18:44 DenisChenu File Added: survey_archive_MSSQL_compare.lsa
2022-12-12 18:44 DenisChenu File Added: MSSQL_bracket.mp4
2022-12-12 18:44 DenisChenu File Added: MSSQL_underscore.mp4
2022-12-12 18:44 DenisChenu Assigned To => DenisChenu
2022-12-12 18:44 DenisChenu Status new => assigned
2022-12-12 18:58 DenisChenu Note Added: 73068
2022-12-12 18:58 DenisChenu Bug heat 0 => 2
2022-12-12 19:02 DenisChenu Note Added: 73069
2022-12-12 19:06 DenisChenu Note Edited: 73069
2023-01-21 13:48 DenisChenu Note Added: 73521
2023-05-04 16:34 DenisChenu Note Added: 74817
2023-05-04 16:35 DenisChenu Assigned To DenisChenu => ollehar
2023-05-04 16:35 DenisChenu Status assigned => feedback
2023-05-04 16:35 DenisChenu Note Added: 74818
2023-05-04 16:36 DenisChenu Note Edited: 74818
2023-05-05 11:46 ollehar Note Added: 74831
2023-05-05 11:46 ollehar Bug heat 2 => 4
2023-05-05 11:47 ollehar Note Added: 74832
2023-05-05 11:47 ollehar Note Edited: 74832
2023-05-05 11:50 DenisChenu Note Added: 74833
2023-05-05 11:50 DenisChenu Status feedback => assigned
2023-05-05 11:51 DenisChenu Note Added: 74834
2023-05-05 11:51 DenisChenu Note Edited: 74834
2023-05-05 12:01 ollehar Note Added: 74835
2023-05-05 15:32 DenisChenu Note Added: 74843
2023-06-16 10:42 c_schmitz Summary MSSQL Reponse filter with underscore or bracket are broken => MSSQL Reponse filter with underscore or bracket not working
2023-06-16 10:42 c_schmitz Description Updated
2023-06-16 10:44 c_schmitz Status assigned => closed
2023-06-16 10:44 c_schmitz Resolution open => won't fix
2023-07-27 15:29 DenisChenu Assigned To ollehar => DenisChenu
2023-07-27 15:29 DenisChenu Status closed => feedback
2023-07-27 15:29 DenisChenu Resolution won't fix => reopened
2023-07-27 15:29 DenisChenu Note Added: 76303
2024-01-19 17:23 DenisChenu Status feedback => assigned
2024-01-19 17:23 DenisChenu Complete LimeSurvey version number (& build) 3.28.42 and 5.4.14 => 5.4.14
2024-06-29 10:03 DenisChenu Assigned To DenisChenu => gabrieljenik
2024-06-29 10:04 DenisChenu Webserver software & version (if known) IIS => https://github.com/LimeSurvey/LimeSurvey/pull/3900
2024-06-29 10:04 DenisChenu Note Added: 80498
2024-06-29 10:08 DenisChenu Status assigned => ready for code review
2024-07-01 16:10 gabrieljenik Assigned To gabrieljenik => tibor.pacalat
2024-07-01 16:10 gabrieljenik Status ready for code review => ready for testing
2024-08-06 14:18 tibor.pacalat Status ready for testing => resolved
2024-08-06 14:34 DenisChenu Changeset attached => LimeSurvey master 23520134
2024-08-06 14:34 DenisChenu Note Added: 80748
2024-08-06 14:34 DenisChenu Assigned To tibor.pacalat => DenisChenu
2024-08-06 14:34 DenisChenu Resolution reopened => fixed
2024-08-06 16:55 LimeBot Note Added: 80755
2024-08-06 16:55 LimeBot Status resolved => closed
2024-08-06 16:55 LimeBot Bug heat 4 => 6