From 981d6660315ac999f7ba847d6f74821df797a41a Mon Sep 17 00:00:00 2001 From: Simon Morris Date: Mon, 6 Jul 2020 14:37:03 +0100 Subject: [PATCH] Go straight to the field type for translated relationship attributes --- src/Entry/EntryModel.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Entry/EntryModel.php b/src/Entry/EntryModel.php index 85bcee29a..49c934b73 100644 --- a/src/Entry/EntryModel.php +++ b/src/Entry/EntryModel.php @@ -428,8 +428,12 @@ public function setAttribute($key, $value) public function getAttribute($key) { - // Check if it's a relationship first. - if (in_array($key, array_merge($this->relationships, ['created_by', 'updated_by']))) { + // Check if it's a relationship first. Ignore translated relationships as these + // end up being handled by the field type anyway. + if ( + in_array($key, array_merge($this->relationships, ['created_by', 'updated_by'])) + && !in_array($key, $this->translatedAttributes) + ) { return parent::getAttribute(camel_case($key)); }