From 6585b6f36bd8fbffd76500f223135335fcb57ec7 Mon Sep 17 00:00:00 2001 From: Bryan Nielsen Date: Thu, 26 Sep 2024 13:52:03 -0400 Subject: [PATCH] Fix relationship support for non-grid fieldtypes using grid columns --- CHANGELOG.md | 1 + src/Fieldtypes/Presenters/Traits/QueriesRelationships.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9a065d..f5ceac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - Return value for Fluid Field when there are no children +- Relationship Fieldtype support for non-grid fieldtypes that reference grid columns ## [1.4.1] - 2024-09-23 diff --git a/src/Fieldtypes/Presenters/Traits/QueriesRelationships.php b/src/Fieldtypes/Presenters/Traits/QueriesRelationships.php index dfded14..e2f1ae2 100644 --- a/src/Fieldtypes/Presenters/Traits/QueriesRelationships.php +++ b/src/Fieldtypes/Presenters/Traits/QueriesRelationships.php @@ -10,7 +10,7 @@ trait QueriesRelationships { public function buildRelationshipQuery(FieldContent $content, Model $model, $tableName = null) { - $isGrid = $content->field->field_type === 'grid'; + $isGrid = $content->field->field_type === 'grid' || ! empty($content->grid_row_id ?? 0); $isFluid = $content->hasAttribute('fluid_field'); $fluidFieldId = ($isFluid) ? $content->fluid_field_data_id : 0;