If a superslot that has been assigned to a region is deleted, an error is thrown when a page is rendered because the superslot block (and it's region assignment) is not removed from the Block table so Drupal still tries to render the block but because it no longer exists an error is thrown.

Comments

dremonkey’s picture

Status: Needs review » Active
StatusFileSize
new1002 bytes

Patch for this issue.

@note This is my first attempt at patching a Drupal module... hope I did it correctly. If not please feel free to tell me how it should have been done. Thanks!

dremonkey’s picture

Assigned: Unassigned » dremonkey
Status: Active » Needs review
dremonkey’s picture

Assigned: dremonkey » Unassigned
jcisio’s picture

You would need another condition on "module" instead of only "delta".

However, I don't understand why we need to manually delete that row from the block table. Did you try to leave that row and clear the cache? Normally in the admin block page, you won't see that block in the list. And even when Drupal tries to render a deleted superslot, the module just returns an empty content.

dremonkey’s picture

Yup... first thing I did was to clear the cache to see if that would remove the error and it didn't work. The error I was seeing is below. 'Test' is the name of the Superslot that I created and assigned to the 'Sidebar First' region, which I then deleted.

Notice: Undefined index: Test in google_admanager_block_view() (line 71 of /Users/ender/Sites/soompi_press/soompi.com/docroot/sites/all/modules/google_admanager/google_admanager.module).

The block no longer shows up in the Admin Block page, but Drupal is still trying to render it, and at least on my machine it is causing the above error message to be displayed.

jcisio’s picture

Ok so the problem is at line 71 with error display set to Notice. I think we should fix it there.

dremonkey’s picture

Yeah... I guess that would work too. But I don't really understand what is wrong with doing some cleanup instead.

What is the point of keeping that data? If a user explicitly deletes the superslot then isn't he/she saying, I don't want this anymore so get rid of all associated data? If the data is kept then if the user creates another superslot with the same name then it automatically inherits the block settings of the previously deleted one. Is that what we want?