Skip to content

[Bug]: Image field grid filter throws TypeError - int given instead of string #453

Description

@wakqasahmed

Affected Version

2026.2

Affected capability

Data Objects

Steps to reproduce

  1. Create a Data Object class with an Image field.
  2. Create a few objects and assign images.
  3. Open the object grid and filter that column by the Image field (relation filter), e.g. via the grid column filter or a saved grid filter that targets the field by asset id.

Actual Behavior

TypeError: Pimcore\Model\DataObject\ClassDefinition\Data\Extension\RelationFilterConditionParser::getRelationFilterCondition(): Argument #1 ($value) must be of type ?string, int given

Image::getFilterConditionExt() forwards the filter value straight to getRelationFilterCondition(?string $value, ...), but the Image field's filter value (an asset id) arrives as an int. Under strict_types=1 that throws before the filter condition is ever built, so filtering an object grid by an Image field fails outright.

Expected Behavior

Filtering by an Image field should build the relation filter condition normally, the same way it does for other relation-backed fields (e.g. ManyToOneRelation, Hotspotimage), regardless of whether the value arrives as an int or a string.

Opening a PR with the fix (cast the value to string before forwarding it, mirroring how the other relation filter callers already handle this) along with a regression test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Affected capability

    Data Objects

    Platform Version

    2026.2

    Galaxy

    None yet

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions