Recently we have this bug ” Notice: Undefined variable: block in …/Template/Filter.php line 187 ” on a project after updating SUPEE-6788 in Magento 1.9.2.x . After installation of the patch some parts of the front-end home page template stayed blank. Review of the exception.log file shows a number of exceptions that occur from the template filter classes of Magento.

The error is: Notice: Undefined variable: block in …/Template/Filter.php line 187

 

The reason causing this problem :

From Magento 1.9.2.x Magento  now includes a white list of allowed blocks or directives. If a module or extension uses variables like {{config path=”web/unsecure/base_url”}} and {{block type=rss/order_new}} in CMS pages or emails, and the directives are not on this list, you will need to add them with your database installation script. Extensions or custom code that handles content (like blog extensions) might be affected -See more at: SUPEE-6788

Solution : 

If your code uses some config variables or blocks, you need to create a data update script that adds variables or blocks to the white list tables:

'permission_variable' 'permission_block'

You can solve it by using one of those ways :

1/ Or creating upgrade script to add your custom block to white list. Reference  at :

How to add variables or blocks to the white list tables

2/ Or creating a file called update.php in your web directory . : public_html/update.php

<?php
require_once 'app/Mage.php';
set_time_limit(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Mage::getSingleton('core/session', array('name' => 'adminhtml'));
$userModel = Mage::getModel('admin/user');
$userModel->setUserId(1);
$session = Mage::getSingleton('admin/session');
$session->setUser($userModel);
$session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());

/*for example*/
$blockNames = array(
    'cms/block',
    'catalog/product_list',
    'manufacturer/manufacturer',
    'featuredproducts/listing',
    'bestseller/bestsellerlist',
    'newproducts/newproductslist'

);
foreach ($blockNames as $blockName) {
    $whitelistBlock = Mage::getModel('admin/block')->load($blockName, 'block_name');
    $whitelistBlock->setData('block_name', $blockName);
    $whitelistBlock->setData('is_allowed', 1);
    $whitelistBlock->save();
}
$variableNames = array(
    'design/email/logo_alt',
    'design/email/logo_width',
    'design/email/logo_height',
);

foreach ($variableNames as $variableName) {
    $whitelistVar = Mage::getModel('admin/variable')->load($variableName, 'variable_name');
    $whitelistVar->setData('variable_name', $variableName);
    $whitelistVar->setData('is_allowed', 1);
    $whitelistVar->save();
}

After that : run yourwebsite.com/update.php.

It’s done. Enjoy coding !