popsu-d7/sites/all/modules/imagecache_actions/customactions/imagecache_customactions.install
2018-03-21 17:06:08 +01:00

24 lines
680 B
Plaintext

<?php
/**
* Rename 'text' to 'php' in custom action effect data.
*/
function imagecache_customactions_update_7100(/*&$sandbox*/) {
$effects = db_select('image_effects')
->fields('image_effects')
->condition('name', 'imagecache_customactions', '=')
->execute()
->fetchAll();
foreach ($effects as $effect) {
$data = unserialize($effect->data);
if (array_key_exists('text', $data)) {
$data['php'] = $data['text'];
unset($data['text']);
$data = serialize($data);
db_update('image_effects')
->condition('ieid', $effect->ieid)
->fields(array('data' => $data))
->execute();
}
}
}