Skip to content

Commit

Permalink
Fixed #15572 GQL not allowing overriding named transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Aug 21, 2024
1 parent cd245df commit a0fb7d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fixed a bug where admin tables weren’t displaying disabled statuses. ([#15540](https://github.com/craftcms/cms/pull/15540))
- Fixed a JavaScript error that occurred when adding a row to an editable table that didn’t allow reordering rows. ([#15543](https://github.com/craftcms/cms/issues/15543))
- Fixed an error that occurred when editing an element with a Link field previously set to a URL value, if the field no longer allows URLs. ([#15542](https://github.com/craftcms/cms/issues/15542))
- Fixed a bug where it wasn’t possible to override named transforms in GraphQL queries. ([#15572](https://github.com/craftcms/cms/issues/15572))

## 5.3.4 - 2024-08-13

Expand Down
12 changes: 5 additions & 7 deletions src/helpers/Gql.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,13 @@ public static function prepareTransformArguments(array $arguments): array|string
{
unset($arguments['immediately']);

if (!empty($arguments['handle'])) {
$transform = $arguments['handle'];
} elseif (!empty($arguments['transform'])) {
$transform = $arguments['transform'];
} else {
$transform = $arguments;
// Remap handle to transform to work with image transform normalization
if (isset($arguments['handle'])) {
$arguments['transform'] = $arguments['handle'];
unset($arguments['handle']);
}

return $transform;
return $arguments;
}

/**
Expand Down

0 comments on commit a0fb7d4

Please sign in to comment.