-
Notifications
You must be signed in to change notification settings - Fork 96
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
Fatal error: Call to undefined method WP_Image_Editor_GD::get_error_message() #1908
Comments
It would also be nice to have some sort of control over how I'd like to handle this situation. While in some cases a warning is a perfectly valid response ("hey admin! shit happened with your file system! take some action NOW"), in this particular case I'd be happy to suppress the warning completely and return either the original image or some stub instead. Even better if I could disable the resizing with a hook, something like: add_filter('ampforwp_should_resize_pictures', function ($shouldResize) {
// No resizing in debug mode, the readonly FS is by design.
return !DEBUG_MODE && $shouldResize;
}); |
@ob-ivan Have you tried changing the code as you suggested? |
@ahmedkaludi Yes, the folder is read-only in some environments, while it is read-write in production environment. @MARQAS Yes, I did that, and the fatal error goes away, but a warning remains:
The problem with the warning is that it gets printed in html, and it looks awful: https://www.dropbox.com/s/72a7txwqk1bjjck/Screenshot%202018-03-21%2016.48.43.png?dl=0 I'm sorry to have confused you. My comment about the warning was a feature request, and I should have created a separate issue for that. |
@ob-ivan Can you share your staging site with the same setup? So we can go deep into it? We haven't written the whole code of aq_resizer, just made some modifications in it. So have to check the code for your use case. I hope you can understand. |
@MARQAS While as a fellow developer I understand the suggestion, I'm not allowed to. My employer is very strict about this. And I don't have a WordPress installation to experiment with on my private servers either :( I believe you can reproduce the issue by temporarily revoking write permissions from the web server user (that is, unless you run apache/nginx from the same user you modify the code with). Then go to wp-admin > AMP Settings > Design > HomePage > Override Homepage Thumbnail Size > Enable, and insert non-standard image sizes. As soon as you request an archive page, a call to Generally, my problem could be solved by providing a filter for So maybe it is easier to go that way? PS. Still the reason for the fatal error is clearly an obvious typo in PPS. Hey, someone's already created one for the original repo: syamilmj/Aqua-Resizer#88 but it seems unsupported now. |
Fix the variable containing WP_Error to avoid a fatal (#1908)
@ob-ivan your pull request has been merged and all the issues related to the |
WordPress version: 4.9.4
AMP for WP version: 0.9.84.1
In our setup, development machines mount images folder from production with readonly permission level.
When the plugin tries to resize a picture on a development machine, it results in a Fatal error, the log follows.
As far as I recognize, there is a typo in
aq_resizer.php
on line 162. Instead of:it should read:
The text was updated successfully, but these errors were encountered: