From e2d49fcb2789d2c3f3a2e66a8babc5cb42242ad9 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 8 Mar 2024 18:09:57 +0100 Subject: [PATCH] Fields _user.* is treated as final paths --- Model/Item.php | 5 ++++- Tests/Model/ItemTest.php | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Model/Item.php b/Model/Item.php index c720384..3c7b3ef 100644 --- a/Model/Item.php +++ b/Model/Item.php @@ -671,7 +671,10 @@ public static function createFromArray(array $array): self */ public static function getPathByField(string $field) { - if (0 === strpos($field, 'indexed_metadata.')) { + if ( + 0 === strpos($field, 'indexed_metadata.') || + 0 === strpos($field, '_user') + ) { return $field; } diff --git a/Tests/Model/ItemTest.php b/Tests/Model/ItemTest.php index 9d1d111..66e32bd 100644 --- a/Tests/Model/ItemTest.php +++ b/Tests/Model/ItemTest.php @@ -545,5 +545,6 @@ public function testPathByField() $this->assertEquals('indexed_metadata.another_id', Item::getPathByField('another_id')); $this->assertEquals('indexed_metadata._field', Item::getPathByField('_field')); $this->assertEquals('indexed_metadata._field', Item::getPathByField('indexed_metadata._field')); + $this->assertEquals('_user.lol', Item::getPathByField('_user.lol')); } }