0

I am getting error of Invalid block on Live site but same code is working in Local system. Can anyone help me in getting out from this ASAP.

Below is my code:

Config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Wildnet_Customsalesgrid>
      <version>0.1.0</version>
    </Wildnet_Customsalesgrid>
  </modules>
  <global>
    <helpers>
      <customsalesgrid>
        <class>Wildnet_Customsalesgrid_Helper</class>
      </customsalesgrid>
    </helpers>
    <events>
        <sales_order_grid_collection_load_before>
            <observers>
                <customsalesgrid>
                    <type>model</type>
                    <class>Wildnet_Customsalesgrid_Model_Observer</class>
                    <method>salesOrderGridCollectionLoadBefore</method>
                </customsalesgrid>
            </observers>
        </sales_order_grid_collection_load_before>
    </events>
    <blocks>
        <adminhtml>
            <rewrite>
                <sales_order_grid>Wildnet_Customsalesgrid_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
            </rewrite>
        </adminhtml>
    </blocks>
  </global>
</config>

Grid.php

<?php

class Wildnet_Customsalesgrid_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid {


    protected function _prepareColumns() {

        $this->addColumnAfter('customer_email', array(
                'header' => Mage::helper('customer')->__('Customer Email'),
                'index' => 'email',
                'type' => 'text',
        ), 'shipping_name');

        return parent::_prepareColumns();
    }

}

Observer.php

<?php

class Wildnet_Customsalesgrid_Model_Observer
{

   public function salesOrderGridCollectionLoadBefore(Varien_Event_Observer $observer) {

       /** @var Mage_Sales_Model_Resource_Order_Grid_Collection $collection */
       $collection = $observer->getEvent()->getOrderGridCollection();

       $collection->getSelect()->join(
           array('customer_table' => $collection->getTable('customer/entity')),
           'main_table.customer_id = customer_table.entity_id',
           'email'
       );
   }
}

This code is working fine in local without any issue but in Live it is showing Invalid block error.

  • i hope definitely some case sensitive issue is there – Mujahidh May 24 '17 at 6:00
  • but this code is working in local system, i am uploading same code on live but it's not working. Suggest please ? – BornCoder May 24 '17 at 6:25
1

Before installing any new extension on Live, Disable the compilation from System -> Tools -> Compilation ->Disable.

Disable cache also and install new extension after installation the run the compilation and enable the cache.

Note: After installation run compilation don't enable it. Compilation will automatically enable otherwise you will get Fatal error and site will be down.

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.