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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | google_admanager-remove_superslot_from_block_table-1353740.patch | 1002 bytes | dremonkey |
Comments
Comment #1
dremonkey commentedPatch 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!
Comment #2
dremonkey commentedComment #3
dremonkey commentedComment #4
jcisio commentedYou 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.
Comment #5
dremonkey commentedYup... 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.
Comment #6
jcisio commentedOk so the problem is at line 71 with error display set to Notice. I think we should fix it there.
Comment #7
dremonkey commentedYeah... 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?