Closed (fixed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 May 2013 at 15:14 UTC
Updated:
23 Jun 2013 at 00:40 UTC
Jump to comment: Most recent file
image_style_flush should be called with an array. (with at least an entry with key = 'name and the value as now is passed as string)
solution 1:
function media_update_7211() {
image_style_flush(array('name' => 'square_thumbnail'));
...
}
Solution 2: to rename an image style you can simply:
$style = image_style_load('square_thumbnail');
if ($style) {
$style['name'] = 'media_thumbnail';
image_style_save($style);
image_style_save() will figure out it is a rename and will call image_style_flush().
I tested solution 2 locally and it works.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | fix-incorrect-image-style-flush-2002870-1.patch | 735 bytes | devin carlson |
Comments
Comment #1
devin carlson commentedNice catch!
A patch to implement solution #2 which seems a bit more robust.
Comment #2
fietserwinThanks for picking this one up.
Code is OK, perhaps update the comment to just mention a renaming of an image style (admins will see it on the update.php page).
Comment #3
devin carlson commentedCommitted #1 to 7.x-2.x.
Comment #4.0
(not verified) commentedUpdated issue summary.