Skip to content

[5.x]: Issue querying against checkbox fields #18127

@TGriffiths88

Description

@TGriffiths88

What happened?

Description

When trying to narrow a query via a checkbox field alone. Combined with other fields it seems to be okay.

{% extends '_/layouts/default' %}

{% block content %}
    {% set test = craft.entries().section('solutions').gender('male').all() %}
    {% dd test %}
{% endblock %}
Image

Steps to reproduce

  1. Create a section
  2. Add a checkbox field to it
  3. Create a few test entries with various values on the checkboxes
  4. Create simple template and try to query the section with a value passed to the checkbox field in the query
  5. It should throw an exception

Expected behavior

It should execute the query absolutely fine

Actual behavior

Throws am exception

Craft CMS version

5.8.20

PHP version

8.3.23

Operating system and version

Linux 6.17.8-orbstack-00308-g8f9c941121b1

Database type and version

MySQL 8.0.40

Image driver and version

Imagick 3.8.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

"craftcms/feed-me": "6.11.0",
"craftcms/postmark": "^3.1",
"nystudio107/craft-retour": "5.0.12",
"nystudio107/craft-seomatic": "5.1.19",
"nystudio107/craft-vite": "5.0.1",
"putyourlightson/craft-blitz": "5.12.5",
"putyourlightson/craft-sprig": "3.7.1",
"vaersaagod/dospaces": "3.2.1",
"verbb/hyper": "2.2.10",
"viget/craft-classnames": "3.0.0",
"vlucas/phpdotenv": "^5.6.0"

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