Skip to content

Commit

Permalink
Merged branch '4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
konradoboza committed Mar 19, 2024
2 parents ecbd789 + 9b1626c commit dd30f3d
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,25 @@ 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
);
Expand Down

0 comments on commit dd30f3d

Please sign in to comment.