0

I have installed an extension on the website. After that I am getting error on the website:

Fatal error: Uncaught Error: Call to a member function setTitle() on boolean in /var/www/example/app/code/core/Mage/Customer/Block/Form/Register.php:43 Stack trace: #0 /var/www/example/app/code/core/Mage/Core/Block/Abstract.php(297): Mage_Customer_Block_Form_Register->_prepareLayout() #1 /var/www/example/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout)) #2 /var/www/example/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('customer/form_r...', 'customer_form_r...') #3 /var/www/example/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('customer/form_r...', 'customer_form_r...') #4 /var/www/example/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element)) #5 /var/www/example/app/code/core/Mage/Core/Model/Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Mo in /var/www/example/app/code/core/Mage/Customer/Block/Form/Register.php on line 43

How to fix the issue?

8
  • After installation did you clear cache?because when you install new extension and don't clear cache then it throw these kind of error so first clear cache then check. Oct 23, 2018 at 12:45
  • I have done it. Oct 23, 2018 at 12:49
  • this error is due to missing head block in your module. check out this link Oct 23, 2018 at 20:17
  • @ShashankKumrawat, Can you please let me know where I need to check this in my module? Oct 24, 2018 at 5:38
  • you can find this using grep command in ubuntu grep ir "setTitle(" app/code/ Oct 24, 2018 at 5:43

1 Answer 1

0

Can you try to set Title in your controller action like below.

public function IndexAction() {
  $this->loadLayout(); // do this first
  $this->getLayout()->getBlock('head')->setTitle($this->__('My Title')); // You need to add this line.
  $this->renderLayout(); // render as usual
}
1
  • I have tried this solution but it is not working Oct 23, 2018 at 12:57

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.