diff --git a/CHANGELOG.md b/CHANGELOG.md index 2902387f..77d5408e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # ImageOptimize Changelog +## 1.4.37 - 2018.08.09 +### Changed +* Reverted an errant commit that removed a fix for propagating field data in multi-site environments +* Ensure that `.webp` variants have fully qualified absolute URLs + ## 1.4.36 - 2018.08.06 ### Added * Added the ability to access each image variant's height diff --git a/composer.json b/composer.json index 89a11642..84b06e68 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nystudio107/craft-imageoptimize", "description": "Automatically create & optimize responsive image transforms, using either native Craft transforms or a service like Imgix, with zero template changes.", "type": "craft-plugin", - "version": "1.4.36", + "version": "1.4.37", "keywords": [ "craft", "cms", diff --git a/src/imagetransforms/CraftImageTransform.php b/src/imagetransforms/CraftImageTransform.php index 17903352..74edd0db 100644 --- a/src/imagetransforms/CraftImageTransform.php +++ b/src/imagetransforms/CraftImageTransform.php @@ -14,7 +14,6 @@ use Craft; use craft\elements\Asset; -use craft\services\Assets; use craft\models\AssetTransform; /** diff --git a/src/imagetransforms/ImageTransform.php b/src/imagetransforms/ImageTransform.php index d61dcd1d..fc49206f 100644 --- a/src/imagetransforms/ImageTransform.php +++ b/src/imagetransforms/ImageTransform.php @@ -133,7 +133,7 @@ public static function appendExtension($pathOrUrl, $extension): string $new_path = $path_parts['filename'] . '.' . $path_parts['extension'] . $extension; if (!empty($path_parts['dirname']) && $path_parts['dirname'] !== '.') { $new_path = $path_parts['dirname'] . DIRECTORY_SEPARATOR . $new_path; - $new_path = preg_replace('#/+#', '/', $new_path); + $new_path = preg_replace('/([^:])(\/{2,})/', '$1/', $new_path); } $output = $path['prefix'] . $new_path . $path['suffix']; diff --git a/src/services/OptimizedImages.php b/src/services/OptimizedImages.php index f9f953b4..62ff3022 100644 --- a/src/services/OptimizedImages.php +++ b/src/services/OptimizedImages.php @@ -293,7 +293,7 @@ public function updateOptimizedImageFieldData(Field $field, ElementInterface $as ->update($table, [ $column => $data, ], [ - 'id' => $asset->contentId, + 'elementId' => $asset->getId(), ], [], false) ->execute(); }