imagecache_customactions.install 680 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * Rename 'text' to 'php' in custom action effect data.
  4. */
  5. function imagecache_customactions_update_7100(/*&$sandbox*/) {
  6. $effects = db_select('image_effects')
  7. ->fields('image_effects')
  8. ->condition('name', 'imagecache_customactions', '=')
  9. ->execute()
  10. ->fetchAll();
  11. foreach ($effects as $effect) {
  12. $data = unserialize($effect->data);
  13. if (array_key_exists('text', $data)) {
  14. $data['php'] = $data['text'];
  15. unset($data['text']);
  16. $data = serialize($data);
  17. db_update('image_effects')
  18. ->condition('ieid', $effect->ieid)
  19. ->fields(array('data' => $data))
  20. ->execute();
  21. }
  22. }
  23. }