2

I have applied patch SUPEE-6788 but this breaks my store and generates an error: Call to a member function isTypeAllowed() on a non-object in Mage/Core/Model/Email/Template/Filter.php

I have whitelisted all blocks and variables, but this problem still occurs.

I found out that replacing Mage/Core/Model/Email/Template/Filter.php with code from before the patch solves the problem.

I can't find out how to track down the problem and solve this. Any suggestions?

5

If you check the Filter.php file after applying 6788 patch, you will find it is adding below bit of code.

if ($this->_permissionBlock->isTypeAllowed($blockParameters['type'])) {
   $type = $blockParameters['type'];
   $block = $layout->createBlock($type, null, $blockParameters);
}

This $this->_permissionBlock is object of Mage::getModel('admin/block'); model which is new settings added by this security patch. you can find this settings in admin.

Admin -> System -> Permission -> Blocks

Check if this settings are exist in your system. Check class Mage_Admin_Model_Block exist in your system or not.

| improve this answer | |
  • Hi akhilesh. I found out that the problem was within an extension that should be updated. Thanks anyway. – Gerard de Visser Dec 4 '15 at 11:07
2

If, like me, you can't update the extension, replacing

if ($this->_permissionBlock->isTypeAllowed($blockParameters['type'])) {
   $type = $blockParameters['type'];
   $block = $layout->createBlock($type, null, $blockParameters);
}

with

if (gettype($this->_permissionBlock) == 'object' && $this->_permissionBlock->isTypeAllowed($blockParameters['type'])) {
   $type = $blockParameters['type'];
   $block = $layout->createBlock($type, null, $blockParameters);
}

should work...

All this does is ensure that the "permission block" is an object before trying to run its member function.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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