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

require_once 'app/Mage.php';
Mage::getSingleton('core/session', array('name' => 'adminhtml'));
$userModel = Mage::getModel('admin/user');
$session = Mage::getSingleton('admin/session');

/*for example*/
$blockNames = array(

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

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

After that : run

It’s done. Enjoy coding !