diff --git a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php index 7ae00d0..8ccb12b 100644 --- a/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php +++ b/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php @@ -39,25 +39,18 @@ public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): strin { $resolver = $this->innerMapper->mapToFieldValueResolver($fieldDefinition); - //making sure we won't be replacing "field" occurrences in the actual field's name - if (preg_match('/"(.*field.*)"/', $resolver) !== 1) { - return str_replace( - 'field', - 'resolver("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])', - $resolver - ); - } - return str_replace( [ 'content', 'location', 'item', + 'field', ], [ 'value.getContent()', 'value.getLocation()', 'value', + 'resolver("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])', ], $resolver );