- Patch #302518 by AlexisWilke: fixed problem with PostgreSQL users not being able to delete blocks.

merge-requests/26/head
Dries Buytaert 2008-10-20 13:00:24 +00:00
parent 3111676cf4
commit a4c679df7a
1 changed files with 2 additions and 2 deletions

View File

@ -306,7 +306,7 @@ function block_add_block_form_submit($form, &$form_state) {
foreach (list_themes() as $key => $theme) {
if ($theme->status) {
db_query("INSERT INTO {blocks} (visibility, pages, custom, title, module, theme, status, weight, delta, cache) VALUES(%d, '%s', %d, '%s', '%s', '%s', %d, %d, %d, %d)", $form_state['values']['visibility'], trim($form_state['values']['pages']), $form_state['values']['custom'], $form_state['values']['title'], $form_state['values']['module'], $theme->name, 0, 0, $delta, BLOCK_NO_CACHE);
db_query("INSERT INTO {blocks} (visibility, pages, custom, title, module, theme, status, weight, delta, cache) VALUES(%d, '%s', %d, '%s', '%s', '%s', %d, %d, '%s', %d)", $form_state['values']['visibility'], trim($form_state['values']['pages']), $form_state['values']['custom'], $form_state['values']['title'], $form_state['values']['module'], $theme->name, 0, 0, $delta, BLOCK_NO_CACHE);
}
}
@ -338,7 +338,7 @@ function block_box_delete(&$form_state, $bid = 0) {
*/
function block_box_delete_submit($form, &$form_state) {
db_query('DELETE FROM {boxes} WHERE bid = %d', $form_state['values']['bid']);
db_query("DELETE FROM {blocks} WHERE module = 'block' AND delta = %d", $form_state['values']['bid']);
db_query("DELETE FROM {blocks} WHERE module = 'block' AND delta = '%s'", $form_state['values']['bid']);
drupal_set_message(t('The block %name has been removed.', array('%name' => $form_state['values']['info'])));
cache_clear_all();
$form_state['redirect'] = 'admin/build/block';