function views_update_6001 in Views (for Drupal 7) 6.3
Same name and namespace in other branches
- 6.2 views.install \views_update_6001()
- 7.3 views.install \views_update_6001()
Remove '$' symbol in special blocks, as it is invalid for theming.
File
- ./
views.install, line 272 - views.install Contains install and update functions for Views.
Code
function views_update_6001() {
$ret = array();
$result = db_query("SELECT * FROM {blocks} WHERE module = 'views' AND delta LIKE '\$exp%'");
while ($block = db_fetch_object($result)) {
$new = strtr($block->delta, '$', '-');
$ret[] = update_sql("UPDATE {blocks} SET delta = '" . db_escape_string($new) . "' WHERE module = 'views' AND delta = '" . db_escape_string($block->delta) . "'");
}
$result = db_query("SELECT * FROM {blocks} WHERE module = 'views'");
while ($block = db_fetch_object($result)) {
$new = $block->delta .= '-block_1';
if (strlen($new) >= 32) {
$new = md5($new);
}
$ret[] = update_sql("UPDATE {blocks} SET delta = '{$new}' WHERE bid = {$block->bid}");
}
return $ret;
}