0

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!

2
  • Did you already performed a search for files containing "company_test/example" ? Commented Feb 25, 2016 at 15:32
  • No, but I am not sure why would this help. Also company_test is just example, actual name is very unique.
    – JohnyFree
    Commented Feb 25, 2016 at 15:49

1 Answer 1

0

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.

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.