Skip to content

findRaw subfield selectors not working with array-type syntax for page reference fields #1563

@billhemsley

Description

@billhemsley

Short description of the issue

Using the array-type selector syntax for subfields, as described in the documentation, findRaw() does not work with page reference fields.

Either there seems to be a bug with the syntax, or the documentation is incorrect.

Expected behavior

Return values from the specified subfields in the same way as the dot syntax does.

Actual behavior

The following causes an exception (where the page reference field is name 'article_regions'):

$pages->findRaw("template=article", [ "title", "article_regions" => [ "id", "title" ] ]);

Exception:

Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'field list' on line: 166 in /home/273028.xxxxx/public_html/wire/core/WireDatabasePDOStatement.php

Note that the following works as expected:

$items = $pages->findRaw("template=article", [ "title", "article_regions.id", "article_regions.title" ]);

Setup/Environment

ProcessWire: 3.0.184
PHP: 7.2.34

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions