diff --git a/src/Tags/Concerns/QueriesConditions.php b/src/Tags/Concerns/QueriesConditions.php index e36ef3936c..778d92a7bd 100644 --- a/src/Tags/Concerns/QueriesConditions.php +++ b/src/Tags/Concerns/QueriesConditions.php @@ -5,6 +5,7 @@ use Carbon\Carbon; use Illuminate\Support\Collection; use Statamic\Contracts\Data\Augmentable; +use Statamic\Contracts\Entries\Entry; use Statamic\Fields\LabeledValue; use Statamic\Fields\Value; use Statamic\Support\Str; @@ -316,7 +317,13 @@ protected function getQueryConditionValue($value, $field) } if ($value instanceof Augmentable) { - $value = $value->augmentedValue($field); + $augmentedValue = $value->augmentedValue($field); + + if (! $augmentedValue && $value instanceof Entry) { + $value = $value->id(); + } else { + $value = $augmentedValue; + } } if ($value instanceof LabeledValue) {