Skip to content

[5.x]: Query with caseInsensitive: true not working when plain text field contains a comma #16409

@vonscriptor

Description

@vonscriptor

What happened?

Description

References

  1. caseInsensitive feature added: Case insensitive custom field params #15404
  2. Documentation: https://craftcms.com/docs/5.x/development/element-queries.html#case-sensitivity

I have a Plain Text field which has values that include a comma(s) ,. When I run a query against that field I add caseInsensitive: true but it doesn't work due to a comma(s) contained in the field value.

Steps to reproduce

  1. Create a Plain Text field and add it to an entry/user.
  2. Give that entry's/user's field a value that includes a comma (e.g. "example,").
  3. Run an entry/user query using with that plain text field that has the value and caseInsensitive: true.
  4. Test querying using different cases for the value (e.g. "Example", "example") and notice how caseInsensitive has no effect—only matching if its case matches.
  5. Remove the comma from the entry's/user's field value and caseInsensitive should then work as expected.

Expected behavior

A comma(s) in the value of a Plain Text field should not cause caseInsensitive: true to not be applied.

Actual behavior

A comma(s) in the value of a Plain Text field causes caseInsensitive: true to not be applied.

Craft CMS version

5.5.9 Pro

PHP version

8.2

Operating system and version

macOS 15.2

Database type and version

MySQL 8.3.0

Image driver and version

Imagick 3.7.0

Installed plugins and versions

  • CKEditor 4.4.0
  • Freeform 5.8.6

(and more…)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions