Skip to content

Commit

Permalink
Merge pull request #16464 from craftcms/bugfix/ckeditor-transforms
Browse files Browse the repository at this point in the history
Ensure DefineAssetUrlEvent is passed transform when parsing refs
  • Loading branch information
brandonkelly authored Jan 21, 2025
2 parents 9ca2bfd + ba7979a commit e9b753f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed an error that could occur when setting `relatedTo*` GraphQL arguments to `null`. ([#16433](https://github.com/craftcms/cms/issues/16433))
- Fixed a bug where old structure data wasn’t getting soft-deleted when a section was assigned a new structure UUID when applying project config changes. ([#16450](https://github.com/craftcms/cms/issues/16450))
- Fixed a bug where `craft\events\DefineAssetUrlEvent::$transform` wasn’t always defined for assets’ `EVENT_BEFORE_DEFINE_URL` and `EVENT_DEFINE_URL` events. ([#16464](https://github.com/craftcms/cms/pull/16464))

## 4.13.10 - 2025-01-14

Expand Down
3 changes: 2 additions & 1 deletion src/elements/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,8 @@ public function getUrl(mixed $transform = null, ?bool $immediately = null): ?str
return null;
}

$transform = $transform ?? $this->_transform;

// Give plugins/modules a chance to provide a custom URL
$event = new DefineAssetUrlEvent([
'transform' => $transform,
Expand Down Expand Up @@ -1961,7 +1963,6 @@ private function _url(mixed $transform = null, ?bool $immediately = null): ?stri
}

$volume = $this->getVolume();
$transform = $transform ?? $this->_transform;

if (
$transform && (
Expand Down

0 comments on commit e9b753f

Please sign in to comment.