You are here

function pay_update_6006 in Pay 6

Same name and namespace in other branches
  1. 7 pay.install \pay_update_6006()

Rename 'activity' to 'action' in pay_method.

File

./pay.install, line 396
Pay module allows for accepting payments against a node using pluggable payment backends.

Code

function pay_update_6006() {
  $ret = array();
  $res = db_query("SELECT * FROM {pay_method}");
  while ($row = db_fetch_object($res)) {
    $settings = unserialize($row->settings);
    if (array_key_exists('pay_form_activity', $settings)) {
      $settings['pay_form_action'] = $settings['pay_form_activity'];
      unset($settings['pay_form_activity']);
      db_query("UPDATE {pay_method}\n        SET settings = '%s' WHERE pmid = %d", serialize($settings), $row->pmid);
    }
  }
  return $ret;
}