title: Magento - Call to a member function createBlock() on a non-object
body: <p>Simply put, I'm getting this error in the Product Admin of Magento after adding a new edit tab.</p>
  
  <pre><code>Fatal error: Call to a member function createBlock() on a non-object in
  /var/www/app/code/local/RedoxStudios/ErpTab/Block/Adminhtml/Catalog/Product/Tab.php
  on line 11
  </code></pre>
  
  <p>I'm having this in my code:</p>
  
  <pre><code>&lt;?php
  class RedoxStudios_ErpTab_Block_Adminhtml_Catalog_Product_Tab
  extends Mage_Adminhtml_Block_Template
  implements Mage_Adminhtml_Block_Widget_Tab_Interface {
  
      /*
       * Set the template for the block
       */
      public function __construct() {
          parent::__construct();
          $this-&gt;getLayout()-&gt;createBlock('Purchase/Product_Widget_StockDetails_Summary');
          $this-&gt;setProduct($this-&gt;getProduct());
          $this-&gt;setTemplate('Purchase/Product/StockDetails/Summary.phtml');
      }
  
      /**
      * Return current product instance
      *
      * @return Mage_Catalog_Model_Product
      */
  
      public function getProduct()
      {
          return Mage::registry('product');
      }
  }
  </code></pre>
  
  <p>Previously I was able to just call the createBlock function. I'm I overlooking something that makes it that I cannot call this function?</p>
  
  <hr>
  
  <p>Summary.phtml:</p>
  
  <pre><code>&lt;div class="stock-details-summary"&gt;
  
  &lt;table border="0"&gt;
      &lt;tr&gt;
          &lt;td class="a-right"&gt;&lt;?php echo $this-&gt;__('Waiting for delivery'); ?&gt; : &lt;/td&gt;
          &lt;td class="a-right"&gt;&lt;?php echo ($this-&gt;getWaitingForDeliveryQty() ? $this-&gt;getWaitingForDeliveryQty() : 0); ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="a-right"&gt;
              &lt;?php echo $this-&gt;__('Manual supply need'); ?&gt; : 
              &lt;?php if ($this-&gt;getManualSupplyNeedQty() &gt; 0): ?&gt;
                  &lt;i&gt;&lt;?php echo $this-&gt;getProduct()-&gt;getmanual_supply_need_comments(); ?&gt;&lt;/i&gt;
              &lt;?php endif; ?&gt;
          &lt;/td&gt;
          &lt;td class="a-right"&gt;
              &lt;?php echo $this-&gt;getManualSupplyNeedQty(); ?&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="a-right"&gt;&lt;?php echo $this-&gt;__('Min qty to purchase'); ?&gt; : &lt;/td&gt;
          &lt;td class="a-right"&gt;&lt;font color="red"&gt;&lt;?php echo $this-&gt;getTotalNeededQtyForValidOrdersMinusWaitingForDelivery(); ?&gt;&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="a-right"&gt;&lt;?php echo $this-&gt;__('Max qty to purchase'); ?&gt; : &lt;/td&gt;
          &lt;td class="a-right" width="60"&gt;&lt;font color="red"&gt;&lt;?php echo $this-&gt;getTotalNeededQtyMinusWaitingForDelivery(); ?&gt;&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="a-right"&gt;&lt;?php echo $this-&gt;__('Status'); ?&gt; : &lt;/td&gt;
          &lt;td class="a-right"&gt;&lt;?php echo $this-&gt;getGeneralStatus(); ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;/div&gt;
  </code></pre>