Skip to content

Commit

Permalink
Merge branch '4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
ibexa-yuna committed May 31, 2024
2 parents 7b94c56 + cff568b commit 8b07f5e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved.
Copyright (C) 1999-2024 Ibexa AS (formerly eZ Systems AS). All rights reserved.

This source code is available separately under the following licenses:

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved.
Copyright (C) 1999-2024 Ibexa AS (formerly eZ Systems AS). All rights reserved.

This source code is available separately under the following licenses:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This package contains a GraphQL server implementation for [Ibexa DXP](https://ww
Ibexa Open Source.

## COPYRIGHT
Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved.
Copyright (C) 1999-2024 Ibexa AS (formerly eZ Systems AS). All rights reserved.

## LICENSE
This source code is available separately under the following licenses:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,7 @@ public function mapToFieldValueType(FieldDefinition $fieldDefinition): string
public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): string
{
$resolver = $this->innerMapper->mapToFieldValueResolver($fieldDefinition);

//we make sure no "field" (case insensitive) keyword in the actual field's identifier gets replaced
//only syntax like: '@=resolver("MatrixFieldValue", [value, "field_matrix"])' needs to be taken into account
//where [value, "field_matrix"] stands for the actual field's identifier
if (preg_match('/value, "(.*field.*)"/i', $resolver) !== 1) {
$resolver = str_replace(
'field',
'resolver("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])',
$resolver
);
}

return str_replace(
$resolver = str_replace(
[
'content',
'location',
Expand All @@ -64,6 +52,19 @@ public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): strin
],
$resolver
);

//we make sure no "field" (case insensitive) keyword in the actual field's identifier gets replaced
//only syntax like: '@=resolver("MatrixFieldValue", [value, "field_matrix"])' needs to be taken into account
//where [value, "field_matrix"] stands for the actual field's identifier
if (preg_match('/value, "(.*field.*)"/i', $resolver) !== 1) {
$resolver = str_replace(
'field',
'resolver("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])',
$resolver
);
}

return $resolver;
}

public function mapToFieldValueInputType(ContentType $contentType, FieldDefinition $fieldDefinition): ?string
Expand Down

0 comments on commit 8b07f5e

Please sign in to comment.