Over at #1057656: Image styles don't flush for images stored non-default schemes there's a patch which fixes the core bug that was preventing it from deleting image styles on remote file schemes (like s3://). With that patch in place, amazons3_image_style_flush() no longer needs to call drupal_rmdir(), which means the hook can be simplified with the attached patch.
This patch also fixes a long-standing bug in amazons3_image_style_flush(), making it treat the $style variable as an array, rather than an object.
EDIT: I just realized that my patch is an updated version of aasarava's patch from #1695102: Actual working implementation of hook_image_style_flush(). I had forgotten that I got the original patch from that issue.
| Comment | File | Size | Author |
|---|---|---|---|
| amazons3_simplified_hook_image_style_flush.patch | 869 bytes | coredumperror |
Comments
Comment #1
haysuess commentedI applied both this patch, and the one mentioned in your comment. I went to one of my Image Styles and hit update, and got this error:
It DID seem to flush the image style though, as my new effects are loading.
Is there something I did wrong?
Comment #2
haysuess commentedLooks like I needed to apply this patch too: https://drupal.org/node/1653316
I have the Beta 7 of Amazon S3 running, not the dev version which is a year newer, so I guess it was missing that fix.
Hope this helps someone else.
Comment #3
djake commentedThis patch was a lifesaver. After updating core to 7.23, I was almost completely unable to edit or add styles. This patch fixed it. Amazon Linux, PHP 5.3.
Comment #4
bkonetzny commentedConfirming that after updating to Drupal 7.23, this patch makes image_style administration workable again.
Comment #4.0
bkonetzny commentedGiving credit where it's due.
Comment #5
justafishThis function isn't needed at all actually thanks to #1057656 and #2079315
https://github.com/justafish/amazons3/commit/bab29e12489275af58bca100416...