I accidentally deleted a view in my D7 website. Good for me I had backup from yesterday, so I put that on my local drupal and exported the view.

The View is getting added successfully but when i visit a node where the view should appear it doesn't and the block panel of the website returns this:

Notice: Undefined index: kontakt-block_1 in _block_rehash() (Zeile 420 von /var/www/drupal-7.19/modules/block/block.module).
Notice: Undefined index: kontakt-block_2 in _block_rehash() (Zeile 420 von /var/www/drupal-7.19/modules/block/block.module).
Notice: Undefined index: kontakt-block_4 in _block_rehash() (Zeile 420 von /var/www/drupal-7.19/modules/block/block.module).
Notice: Undefined index: kontakt-block_6 in _block_rehash() (Zeile 420 von /var/www/drupal-7.19/modules/block/block.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'rubel_zf-views-Kontakt-block_1' for key 'tmd': INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => views [:db_insert_placeholder_1] => Kontakt-block_1 [:db_insert_placeholder_2] => rubel_zf [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => -1 [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => -1 ) in drupal_write_record() (Zeile 7194 von /var/www/drupal-7.19/includes/common.inc).

If I delete the View again the blocks panel opens without a error.

any idea how I can fix this? A lot of work was done in the meantime and the bad thing not only by me. Other employees did add content. All that well be gone ;(

1 Answer 1


First back up the live site in its current state.

On your local site running your backup database enable the database administration module

And use that to export the tables labeled 'views_views' and 'views_display' in format 'mysqldump'

On your live site, import your sql files

Then run:

mysql -u root -p drupaldb < views-views.sql
mysql -u root -p drupaldb < views-display.sql

I used this issue thread for reference.

It's worth noting that because your errors also seem to be coming from blocks (and assuming no one else has worked on them in the meantime) you might also want to do the same as above with your 'block' 'block_current_search' 'block_custom' 'block_node_type' 'block_role' tables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.