-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Describe the bug
When we first upload a new image into a Matrix field, and before we have Saved the entry, we get our "not found" placeholder. This definitely does not happen with ImageOptimize's normal CraftImageTransform class.
This seems to be specific to:
a) Matrix blocks
b) where the Assets field uses a Twig expression including {{ owner.[something] }} to restrict the folder
I tested, and Asset fields inside Matrix blocks in general work fine, as do non-Matrix Asset fields that use a Twig expression.
I know there were some vaguely recent changes to thumbnailing behavior by Craft itself (I had to report a bug to Craft about their thumbnail handling about a month ago), so I wonder if something isn't hooking together correctly?
To reproduce
Steps to reproduce the behaviour:
- Create a Matrix field
- Create a block type
- Create an asset field in your block
- Set the Asset field's Default Asset Location to
{{owner.site.handle}} - Make sure "Allow uploading directly to the field" is checked on the Asset field
- Add your Matrix field to a section, then try uploading a new photo directly using "Upload a File"
Expected behaviour
The actual image thumbnail should show as soon as the image is uploaded, instead of showing our "not found" placeholder.
Screenshots
Versions
- Plugin version: ImageOptimize 1.6.38
- Craft version: Craft Pro 3.7.26
