and from blocks admin page and their instances haven't been deleted.
We should build some sort of check to do all the house-cleaning of "orphaned"
blocks, perhaps each time we arrive to the blocks admin page.
foreach($pageblocks[$position] as $instance) {
$block = blocks_get_record($instance->blockid);
+
+ if (empty($block)) {
+ // Block doesn't exist! We should delete this instance!
+ continue;
+ }
+
if(!$block->visible) {
// Disabled by the admin
continue;
continue;
}
+ if (!array_key_exists($instance->blockid, $blocks)) {
+ // Block doesn't exist! We should delete this instance!
+ continue;
+ }
+
if(!$blocks[$instance->blockid]->visible) {
continue;
}