1 Comment

How Magento process block defined inside layout xml?

Change CSS for navigation bar
Reduce queries of OnePica Image CDN

I have strange situation where block defined in xml is not loaded. Everything is properly defined and it works on more than 500 stores. It is simple layout file like this:

layout.xml

  <?xml version="1.0"?>   
  <layout version="1.0.0">   
    <test_index_index>   
      <reference name="root">   
        <action method="setTemplate"><template>page/1column.phtml</template></action>   
      </reference>   
      <reference name="content">   
        <block type="company_test/example" name="test_index" template="test/index.phtml"/>   
      </reference>   
    </test_index_index>   
  </layout>   

config.xml

  <?xml version="1.0"?>
  <config>  
    <modules>
        <Company_Test>
            <version>1.5.0</version>
        </Company_Test>
    </modules>  
    <global> 
          <helpers>
              <company_test>
                  <class>Company_Test_Helper</class>
              </company_test>
          </helpers>         
          <blocks>
              <company_test>
                  <class>Company_Test_Block</class>
              </company_test>    
          </blocks>                                      
    </global>                   
  </config>   

Which normally work, but in one particular store it won’t work after upgrading the extension. But if I rename folder Company to Companyy and rename company also inside files it will work:

<block type="companyy_test/example" name="test_index" template="test/index.phtml"/> 

The same happens also if I put test_index block into any other extension layout file inside this store, it won’t work when first folder name is Company. My guess it that old file is still in server cache (not Magento cache). It won’t log any error.

Now to my question. Which file gets block path from layout file and try to handle/process it? Before I start debugging and researching core files it would be useful if I can get any hint where to start.

tnx!

Related Posts

Change CSS for navigation bar
Reduce queries of OnePica Image CDN

1 Comment on this article

  • User November 12, 2016

    The problem was because somebody disabled extension, not for global scope but only for website scope. Extension appeared in admin, calling block didn’t print any error or false statement, just empty string. Debugging lead me to file app/code/core/Mage/Core/Block/Abstract.php to function toHtml() and inside this function there are lines:

    if (Mage::getStoreConfig('advanced/modules_disable_output/' . $this->getModuleName())) {
        return '';
    }
    

    which lead me to the conclusion.

    Reply

Add a comment