2

I have create a block on template email on magento 1.8.1

  {{block type="core/template" area="frontend" template="email/bankdetails.phtml" order=$order store=$store }}

it worked normally. But when I install a security pacth 6788, It did not work. I checked System > Permissions > Blocks and I saw the blocks (core/template) are allowed for inclusion. How can I fix that problem?

  • Did you solved your problem ? – Proxium Jan 20 '16 at 20:28
1

Here is a good Magerun addons that helps you to whitelist blocks and variables https://github.com/peterjaap/magerun-addons#find-non-whitelisted-varsblocks-to-be-compatible-with-supee-6788-and-magento-1922

You can then add them using a data install script (eg. /app/code/local/Company/ Module/data/company_module/data-install-0.1.0.php)

//Make sure the upgrade is not performed on installations without the tables (i.e. unpatched shops).

$adminVersion = Mage::getConfig()->getModuleConfig('Mage_Admin')->version;
if (version_compare($adminVersion, '1.6.1.2', '>=')) {

$blockNames = array(
    'cms/block',
    'newsletter/subscribe',
    'onsaleslider/onsaleslider',
    'mostviewedproductslider/mostviewedproductslider'
);

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();
}
}

Clear the cache and post the result.

| 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.