1

my config.xml is :

<?xml version="1.0"?>
<config>
    <modules>
        <Premium_PlatinumBlock>
            <version>1.0.0</version>
        </Premium_PlatinumBlock>
    </modules>
    <global>
        <helpers>
            <premium_platinumblock>
                <class>Premium_PlatinumBlock_Helper</class>
            </premium_platinumblock>
        </helpers>
        <resources>
            <premium_platinumblock_setup>
                <setup>
                    <module>Premium_PlatinumBlock</module>
                </setup>
            </premium_platinumblock_setup>
        </resources>
    </global>
</config>

my installer script -

Premium/PlatinumBlock/sql/premium_platinumblock_setup/mysql4-install-1.0.0.php
$installer = $this;
$installer->startSetup();
$storeId    = 2;
$type       = 'block';
$title      = 'Block123';
$identifier = 'my_block';
$content = <<<'EOD here'
EOD;

Mage::getModel('cms/'.$type)
        ->setStoreId($storeId)
        ->load($identifier)
        ->setTitle($title)
        ->setIdentifier($identifier)
        ->setStores(array($storeId))
        ->setIsActive(true)
        ->setContent($content)
        ->save();
$installer->endSetup();
3
  • 1
    try replacing <module>premium_PlatinumBlock</module> by <module>Premium_PlatinumBlock</module> Mar 24, 2017 at 11:15
  • this is just a typing mistake here. Its not working out. is it different for magento 1.4 Mar 24, 2017 at 11:57
  • Just to be sure, there is a file app/etc/modules/Premium_PlatinumBlock.xml where it says that the extension is active? Also check the core_resource table in the database and check if your extension is listed there and check the version of the extension. If that's already 1.0.0 or higher, your installer will not be executed. Mar 31, 2017 at 6:15

1 Answer 1

2

Here I was missing the class in setup, that's why it was not running. I fixed it like

    <resources>
        <platinumblock_setup >
            <setup>
                <module>PlatinumBlock</module>
                <class>Mage_Core_Model_Resource_Setup</class>
            </setup>
        </platinumblock_setup >
    </resources>
</global>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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