Skip to content

Commit

Permalink
Merge branch '4.4' into a11y/login-announcement
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jan 10, 2023
2 parents 8c549ab + ade6c2f commit 431e4f4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- Added the `{% dump %}` tag, which dumps variables into a new “Dumps” Debug Toolbar panel. ([#12506](https://github.com/craftcms/cms/pull/12506))
- The `dump()` Twig function now utilizes `Craft::dump()`, and no longer requires Dev Mode to be active. ([#12486](https://github.com/craftcms/cms/pull/12486), [#12479](https://github.com/craftcms/cms/discussions/12479))
- The `{% dd %}` Twig tag can now output the entire `context` array, if no variable is passed to it. ([#12486](https://github.com/craftcms/cms/pull/12486))
- Added `craft\elements\Asset::getFormat()`. ([#12398](https://github.com/craftcms/cms/pull/12398))
- `Craft::dump()`, `Craft::dd()`, the `dump()` Twig function, and the `{% dd %}` Twig tag now use Symfony’s VarDumper. ([#12479](https://github.com/craftcms/cms/discussions/12479))
- `craft\elements\Asset::getMimeType()` now has a `$transform` argument, and will now return the MIME type of the asset with a transform applied, when appropriate. ([#12269](https://github.com/craftcms/cms/discussions/12269), [#12397](https://github.com/craftcms/cms/pull/12397))

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Removed the “Timeout” setting from the Gmail and SMTP mailer transporters, as they aren’t supported by Symfony Mailer’s transport configuration.
- Removed the “Encryption Method” setting from the SMTP mailer transporter, as Symfony Mailer already uses TLS when port 465 is used (as it is by default).
- The “Port” setting on the SMTP mailer transporter is no longer required. It will default to 465 or 25 depending on whether OpenSSL is installed.
- Fixed field status badge styling in some contexts. ([#12403](https://github.com/craftcms/cms/issues/12403))
- Deprecated `craft\helpers\DateTimeHelper::timeZoneAbbreviation()`.
- Deprecated `craft\helpers\DateTimeHelper::timeZoneOffset()`.

Expand Down
20 changes: 19 additions & 1 deletion src/elements/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -1734,13 +1734,31 @@ public function getMimeType(mixed $transform = null): ?string
return FileHelper::getMimeTypeByExtension('.' . $transform->format);
}

/**
* Returns the file's format, if it can be determined.
*
* @param ImageTransform|string|array|null $transform A transform handle or configuration that should be applied to the image
* @return string|null The asset's format
* @throws ImageTransformException If an invalid transform handle is supplied
*/
public function getFormat(mixed $transform = null): ?string
{
$transform = $transform ?? $this->_transform;
$transform = ImageTransforms::normalizeTransform($transform);

if (!Image::canManipulateAsImage($this->getExtension()) || !$transform || !$transform->format) {
return $this->getExtension();
}

return $transform->format;
}

/**
* Returns the image height.
*
* @param ImageTransform|string|array|null $transform A transform handle or configuration that should be applied to the image
* @return int|null
*/

public function getHeight(mixed $transform = null): ?int
{
return $this->_dimensions($transform)[1];
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/src/js/ElementEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ Craft.ElementEditor = Garnish.Base.extend(

const $fields = $(selectors.join(','))
.parents()
.filter('.field:not(:has(> .status-badge))');
.filter('.flex-fields > .field:not(:has(> .status-badge))');
for (let i = 0; i < $fields.length; i++) {
$fields.eq(i).prepend(
$('<div/>', {
Expand Down

0 comments on commit 431e4f4

Please sign in to comment.