Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] Upgrade from 4.2.7 to 4.3.0 destroys images #12210

Closed
anbod-io opened this issue Oct 27, 2022 · 7 comments
Closed

[4.x] Upgrade from 4.2.7 to 4.3.0 destroys images #12210

anbod-io opened this issue Oct 27, 2022 · 7 comments
Assignees

Comments

@anbod-io
Copy link

anbod-io commented Oct 27, 2022

What happened?

[4.x]: I've just updated my site from Craft 4.2.7 to 4.3.0 and it seems that there is something very toxic in the update somewhere. After the upgrade I was seeing that several images were no longer being rendered.I then re-indexed my image assets, and afterwards no images at all were being rendered on the site.I think this would have already been reported from the field if this were a native image/transform problem, so without any investigation at all I am going to assume the problem is because I use ImageOptimize.There appears to be a little fight going on between ImageOptimimize and Craft 4.3.0

Description

Steps to reproduce

  1. Upgrade Craft from 4.2.7 to 4.3.0

Expected behavior

The site behaves normally, with whatever new functionality comes with the update

Actual behavior

Images no longer render on the site.

Craft CMS version

4.2.7 (Pro)

PHP version

8.1.11

Operating system and version

Linux 5.10.0-18-amd64

Database type and version

MySQL 5.7.39

Image driver and version

Imagick 3.6.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

  • Asset Count 2.0.0
  • Asset Usage 3.0.0
  • Cloner 2.0.3
  • CP Field Inspect 1.4.4
  • Digital Download 2.2.1
  • Environment Label 4.0.2
  • Field Manager 3.0.4
  • Freeform 4.0.6
  • GDPR Cookie Consent 4.0.4
  • ImageOptimize 4.0.2
  • MatrixMate 2.1.1
  • Navigate 3.0.2
  • Obfuscator 1.1.1
  • PDF Transform 2.0.0
  • Redactor 3.0.2
  • Redactor Tweaks 3.0.0
  • SEO v4.0.3
  • Super Table 3.0.2
  • Tweet Feed 4.1.0.1
  • Typogrify 4.0.0
  • Wordsmith 4.0.1
@anbod-io anbod-io changed the title [4.x]: I've just updated my site from Craft 4.2.7 to 4.3.0 and it seems that there is something very toxic in the update somewhere. After the upgrade I was seeing that several images were no longer being rendered.I then re-indexed my image assets, and afterwards no images at all were being rendered on the site.I think this would have already been reported from the field if this were a native image/transform problem, so without any investigation at all I am going to assume the problem is because I use ImageOptimize.There appears to be a little fight going on between ImageOptimimize and Craft 4.3.0 Upgrade from 4.2.7 to 4.3.0 destroys images Oct 27, 2022
@thijskaspers
Copy link

Can confirm. After disabling the "ImageOptimize" plugin, images are working as they should.

@anbod-io anbod-io changed the title Upgrade from 4.2.7 to 4.3.0 destroys images [4.x] Upgrade from 4.2.7 to 4.3.0 destroys images Oct 27, 2022
@brianjhanson brianjhanson self-assigned this Oct 27, 2022
@jl-digital
Copy link

Can confirm as well. I've reported the issue @khalwat nystudio107/craft-imageoptimize#360

@brandonkelly
Copy link
Member

brandonkelly commented Oct 27, 2022

This was due to an unintended breaking change in 4.3.0, where Asset::getUrl() was respecting plugins which set $event->url = null, as ImageOptimize is doing (5c837e4).

Fixed for the next Craft 4 release (3f00b8d).

@anbod-io
Copy link
Author

Outstanding, thanks for such a quick response!

@mightyfineyall
Copy link

@brandonkelly Not sure this is just a plugin issue - I use a custom twig function to render our imagery, and updating to 4.3 just broke asset indexes on a staging site. I had to define the webroot alias in general.php and then add the full path in .env in order to get it to index correctly again. It still broke all my asset relations in entries (thankfully not that many) and left a full /srv path in the assets folder:
image

@brandonkelly
Copy link
Member

@mightyfineyall Not really sure what to make of that, but probably unrelated to this issue? Can you please post a new issue with as much detail as you can think of:

  • What was your @webroot alias set to, to begin with?
  • Any relevant .env values for defining paths/URLs
  • What are your filesystems’ Base Path settings set to?
  • What is /srv?
  • What happened after updating to 4.3?
  • What all did you change when attempting to fix this?
  • Anything else you can think of that might be relevant.

@brandonkelly
Copy link
Member

Craft 4.3.1 has been released with the fix for ImageOptimize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants