Skip to content

Commit

Permalink
Merge branch '4.x' of https://github.com/craftcms/cms into 5.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
brandonkelly committed Aug 21, 2024
2 parents bbba6b4 + df40816 commit be00ff8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Fixed a bug where Money fields’ min, max, and default values weren’t being set to the correct currency. ([#15565](https://github.com/craftcms/cms/issues/15565), [#15566](https://github.com/craftcms/cms/pull/15566))
- Fixed a bug where Money fields weren’t handling negative values correctly. ([#15565](https://github.com/craftcms/cms/issues/15565), [#15567](https://github.com/craftcms/cms/pull/15567))
- Fixed a bug where PHP-originated Craft Console API requests weren’t timing out if the API was down. ([#15571](https://github.com/craftcms/cms/pull/15571))
- Fixed a bug where it wasn’t possible to override named transforms in GraphQL queries. ([#15572](https://github.com/craftcms/cms/issues/15572))
- 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))
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
5 changes: 3 additions & 2 deletions tests/unit/gql/ElementFieldResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,9 @@ public static function assetTransformDataProvider(): array
[['width' => 200, 'height' => 200], ['width' => 200, 'height' => 200]],
[['width' => 400, 'height' => 200], ['width' => 400, 'height' => 200]],
[['width' => 200, 'height' => 500], ['width' => 200, 'height' => 500]],
[['width' => 200, 'height' => 200, 'handle' => 'testHandle'], ['handle' => 'testHandle']],
[['width' => 200, 'height' => 200, 'transform' => 'testHandle2'], ['handle' => 'testHandle2']],
// Overriding named transforms
[['width' => 200, 'height' => 200, 'handle' => 'testHandle'], ['handle' => null, 'width' => 200, 'height' => 200]],
[['width' => 200, 'height' => 200, 'transform' => 'testHandle2'], ['handle' => null, 'width' => 200, 'height' => 200]],
];
}
}

0 comments on commit be00ff8

Please sign in to comment.