From ab0e4dd42f433a5b0ed501c0a3daebc108ed1941 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Wed, 24 Nov 2004 09:16:39 +0000 Subject: [PATCH] If a block is unknown then ignore it rather than throwing fatal error. In future one might want to have a dummy block that is displayed in this case to alert the user to the fact that some block code is missing. --- lib/blocklib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/blocklib.php b/lib/blocklib.php index 59af30d340c..3d26dee8073 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -198,7 +198,10 @@ function blocks_print_group(&$page, &$instances) { continue; } - $obj = block_instance($block->name, $instance); + if (!$obj = block_instance($block->name, $instance)) { + // Invalid block + continue; + } if ($isediting) { $options = 0;