diff --git a/src/Fieldtypes/Entries.php b/src/Fieldtypes/Entries.php index f29272c518..f6306e6808 100644 --- a/src/Fieldtypes/Entries.php +++ b/src/Fieldtypes/Entries.php @@ -23,6 +23,7 @@ use Statamic\Search\Index; use Statamic\Search\Result; use Statamic\Support\Arr; +use Statamic\Taxonomies\LocalizedTerm; class Entries extends Relationship { @@ -321,7 +322,7 @@ protected function collect($value) public function augment($values) { $site = Site::current()->handle(); - if (($parent = $this->field()->parent()) && $parent instanceof Localization) { + if (($parent = $this->field()->parent()) && ($parent instanceof Localization || $parent instanceof LocalizedTerm)) { $site = $parent->locale(); } diff --git a/src/Fieldtypes/Terms.php b/src/Fieldtypes/Terms.php index 4a9bef98a5..51884e22bd 100644 --- a/src/Fieldtypes/Terms.php +++ b/src/Fieldtypes/Terms.php @@ -22,6 +22,7 @@ use Statamic\Query\Scopes\Filters\Fields\Terms as TermsFilter; use Statamic\Support\Arr; use Statamic\Support\Str; +use Statamic\Taxonomies\LocalizedTerm; class Terms extends Relationship { @@ -111,7 +112,7 @@ public function augment($values) // entry, but could also be something else, like another taxonomy term. $parent = $this->field->parent(); - $site = $parent && $parent instanceof Localization + $site = $parent && ($parent instanceof Localization || $parent instanceof LocalizedTerm) ? $parent->locale() : Site::current()->handle(); // Use the "current" site so this will get localized appropriately on the front-end.