I have created a module to display the Magento native captcha in the contact form and it is working fine on my localhost. But when I upload it on the server it is showing the following error

Fatal error: Call to a member function getBlockName() on a non-object in /public_html/app/code/core/Mage/Captcha/Block/Captcha.php on line 43

I have tried some methods like clearing the cache and session files.

What can I do to resolve this?


Captcha requires a form id which is given in captcha layout file, the code is used as

<action method="setFormId"><formId>contact_form</formId></action>

you can follow this tutorial Captcha for contact us.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.