Skip to content

Commit

Permalink
Revert "IBX-7979: Fixed "field" occurrences being wrongly replaced" (#60
Browse files Browse the repository at this point in the history
)

This reverts commit d34971b.
  • Loading branch information
webhdx authored Mar 20, 2024
1 parent d34971b commit 4eeeee9
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down

0 comments on commit 4eeeee9

Please sign in to comment.