Skip to content

Pages->find Selector throws error if can't match against FieldtypeOptions field #1468

@mrjcgoodwin

Description

@mrjcgoodwin

Short description of the issue

Running a pages->(selector) against a Select Options Fieldtype (FieldtypeOptions) field using checkboxes throws an error if the selector returns no matches.

Expected behavior

If no matches are found, return an empty pages object with count property set to zero (as per other field types).

Actual behavior

An error is thrown if selector doesn't find a match:
Error: Exception: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters (in wire/core/PageFinder.php line 627)".

Steps to reproduce the issue

  1. Create a FieldtypeOptions field with multiple checkbox options.
  2. Apply field to a template and create a page using that template (do not check any checkbox options).
  3. Create a selector: $foo = $pages->find("your_checkbox_field=bar")
  4. Load page to see error.

Setup/Environment

PHP version: 7.4.24
ProcessWire 3.0.165

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions