You are here

function webform_conditional_update_6001 in Webform Conditional (Same Page Conditionals) 7.2

Same name and namespace in other branches
  1. 6 webform_conditional.install \webform_conditional_update_6001()
  2. 7 webform_conditional.install \webform_conditional_update_6001()

@todo Please document this function.

See also

http://drupal.org/node/1354

File

./webform_conditional.install, line 88
Install, update and uninstall functions for the webform_conditional module.

Code

function webform_conditional_update_6001() {
  $ret = array();
  $sql = "SELECT nid, cid,extra FROM {webform_component}";
  $result = db_query($sql);
  if ($result) {
    while ($row = db_fetch_array($result)) {
      $extra = unserialize($row['extra']);
      if (!empty($extra['webform_conditional_mandatory'])) {
        $update_components[$row['nid']][] = $row['cid'];
      }
    }
    if ($update_components) {
      foreach ($update_components as $nid => $cids) {

        // TODO update_sql has been removed. Use the database API for any schema or data changes.
        $ret[] = array();
      }
    }
  }

  // hook_update_N() no longer returns a $ret array. Instead, return
  // nothing or a translated string indicating the update ran successfully.
  // See http://drupal.org/node/224333#update_sql.
  return t('TODO Add a descriptive string here to show in the UI.');
}