Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After I have installed the following patches: SUPEE-6285-1.9.1v2, SUPEE-6482-1.9.1.1, SUPEE-6788-1.9.1.1, SUPEE-7405-1.9.1.1, my system.log file is filled with full of the following errors:

Notice: Undefined variable: block in app/code/core/Mage/Core/Model/Email/Template/Filter.php on line 187
Notice: Undefined variable: block in app/code/core/Mage/Core/Model/Email/Template/Filter.php on line 197

How to fix the issue...

Here is the block code:

    /**
 * Retrieve Block html directive
 *
 * @param array $construction
 * @return string
 */
public function blockDirective($construction)
{
    $skipParams = array('type', 'id', 'output');
    $blockParameters = $this->_getIncludeParameters($construction[2]);
    $layout = Mage::app()->getLayout();

    if (isset($blockParameters['type'])) {
        if ($this->_permissionBlock->isTypeAllowed($blockParameters['type'])) {
            $type = $blockParameters['type'];
            $block = $layout->createBlock($type, null, $blockParameters);
        }
    } elseif (isset($blockParameters['id'])) {
        $block = $layout->createBlock('cms/block');
        if ($block) {
            $block->setBlockId($blockParameters['id']);
        }
    }

 **LINE 187**   if ($block) {
        $block->setBlockParams($blockParameters);
        foreach ($blockParameters as $k => $v) {
            if (in_array($k, $skipParams)) {
                continue;
            }
            $block->setDataUsingMethod($k, $v);
        }
    }

 **LINE 197**   if (!$block) {
        return '';
    }
    if (isset($blockParameters['output'])) {
        $method = $blockParameters['output'];
    }
    if (!isset($method) || !is_string($method) || !method_exists($block, $method)) {
        $method = 'toHtml';
    }
    return $block->$method();
}

any help would be appreciated...

share|improve this question

migrated from meta.magento.stackexchange.com yesterday

This question came from our discussion, support, and feature requests site for users of the Magento e-Commerce platform.

up vote 5 down vote accepted

Did you whitelist the blocks and vars in the backend?

Try to know which block to whitelist by printing debug information in app/code/core/Mage/Core/Model/Email/Template/Filter.php

If not try the following:

DON'T TRY OTHER COMMANDS UNLESS YOU REALLY KNOW WHAT YOU DO AS IT MAY BREAK YOUR WHOLE INSTALLATION!

share|improve this answer
    
That's it... fixed... :) thank you sooo much Michael... – Doodu yesterday
    
Do you know any patch fix to this issue? magento.stackexchange.com/questions/105113/… – Doodu yesterday
    
Would be nice, if you could accept this as answer. Thanks – Michael yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.