0

I accedently 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 vist a node where the view should appear it doesnt 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? Alot 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 ;(

SaifDeen
  • 862
  • 2
  • 16
  • 33

3 Answers3

1

I've got exactly the same problem and I notice that it comes from the name of the view when importing: Do NOT put a name of view, just leave the field blank and click on the "Replace an existing view if one exists with the same name".

Chrigou
  • 71
  • 9
0

I believe your view comes with a different machine name or block ids? You may want to figure out where are the blocks being called from and try to fix the way they get called. Might be in the template - I assume that when you deleted the view, the blocks that view created also got deleted.

After adding the view, can you see the blocks generated by this view in admin, under blocks? Try disabling them and see if your page shows the error again.

NickOpris
  • 509
  • 2
  • 8
  • 20
  • I cant visit the blocks view, the error shows up :S – SaifDeen Feb 17 '14 at 18:09
  • I would suggest to change the name of the blocks and see if you get same error messages. The idea is that your blocks are being called from your template without being checked if they exist. There is definitely a wrong association of the old block names in that database. I'm sorry I can't be of more help - you need to follow the code from the view to your pages... – NickOpris Feb 18 '14 at 11:51
0

Change the machine name of your block under Advanced.

JPashs
  • 13,044
  • 10
  • 42
  • 65