Skip to content

Commit

Permalink
Another fix for previewPlaceholderHtml changes in Craft 5.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgrayisok committed Dec 3, 2024
1 parent 25d0450 commit ce52bfe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes for Servd Assets and Helpers

## 4.0.11 - 2024-12-03

### Fixed

- Another fix for compatibility with previewPlaceholderHtml changes in Craft 5.5.0

## 4.0.10 - 2024-11-22

### Updated
Expand All @@ -9,6 +15,8 @@

## 4.0.9 - 2024-11-15

### Fixed

- Speculative fix for compatibility with previewPlaceholderHtml changes in Craft 5.5.0

## 4.0.8 - 2024-09-30
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "servd/craft-asset-storage",
"description": "Servd Asset Storage and Helpers integration for Craft CMS",
"version": "4.0.10",
"version": "4.0.11",
"type": "craft-plugin",
"keywords": [
"cms",
Expand Down
8 changes: 6 additions & 2 deletions src/AssetsPlatform/AssetsPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,15 @@ public function getFileUrl(Asset $asset)
}

// Append dm query parameter to allow cache busting if the underlying asset changes
$dmTimestamp = 0;
if (!empty($asset->dateUpdated)){
$dmTimestamp = $asset->dateUpdated->getTimestamp();
}
$finalUrlQuery = parse_url($finalUrl, PHP_URL_QUERY);
if ($finalUrlQuery) {
$finalUrl .= '&dm=' . $asset->dateUpdated->getTimestamp();
$finalUrl .= '&dm=' . $dmTimestamp;
} else {
$finalUrl .= '?dm=' . $asset->dateUpdated->getTimestamp();
$finalUrl .= '?dm=' . $dmTimestamp;
}

return $finalUrl;
Expand Down

0 comments on commit ce52bfe

Please sign in to comment.