Sharing is helping.

We offer you this space to share your knowledge about Magento and learn from our experienced customers.


    Home Forums Theme Forum HelloSimple Contact form not working (Hellosimple's latest version on Magento 1.4) Reply To: Contact form not working (Hellosimple's latest version on Magento 1.4)

    #13911

    Anonymous

    Magento bug… Found the solution here : http://www.magentocommerce.com/boards/viewthread/22218/

    ——

    I’ve tracked down the point in the code where the problem is occurring and have a solution.

    Starting at line 87 in /app/code/core/Mage/Contacts/controllers/IndexController.php is the following code:

    if (Zend_Validate::is(trim($post['hideit']), ‘NotEmpty’)) {
    $error = true;
    }

    This appears to be checking for an entry in the hidden form field ‘hideit’ – presumably as an anti-spam measure. Validation fails if there’s an entry in the field – or as in this case if the field is missing.

    I’ve just updated my site from 1.3.2.2 to 1.4. So I’m guessing this is a change introduced in the new version. There’s a revised standard form template in the new version with this new field. But my site is using a custom template from before this new feature was added. So the validation is failing because the field is missing.

    A quick and dirty fix is to comment out the above lines to skip the validation – not advisable though as it’s a core file which may be updated next time there’s an upgrade.

    The proper solution is to update the form template to include the new hidden field:

    <input type=”text” name=”hideit” id=”hideit” value=”" style=”display:none !important;” />

    Hope that helps!

    ——

    :)