You are here

function apachesolr_search_update_6001 in Apache Solr Search 6

Same name and namespace in other branches
  1. 6.2 apachesolr_search.install \apachesolr_search_update_6001()

Update to block deltas.

File

./apachesolr_search.install, line 45
Install and related hooks for apachesolr_search.

Code

function apachesolr_search_update_6001() {
  $ret = array();
  if ($fields = apachesolr_cck_fields()) {
    foreach ($fields as $name => $field) {
      $index_key = substr(apachesolr_index_key($field), 0, 32);
      $new_delta = $field['field_name'];
      $ret[] = update_sql("UPDATE {blocks} SET delta = '" . $new_delta . "' WHERE module = 'apachesolr_search' AND delta = '" . $index_key . "'");
      $ret[] = update_sql("UPDATE {blocks_roles} SET delta = '" . $new_delta . "' WHERE module = 'apachesolr_search' AND delta = '" . $index_key . "'");
    }
  }
  return $ret;
}