This looks like a very promising solution to a long-standing problem, thank you!
I would be grateful if you could clarify a couple of points in the documentation please.

  • It appears that this module uses the Contact module form to send emails. Is this correct
  • If so, does this mean it should be compatible with modules such as Mollom which protect contact forms from spam?
  • If so, why does it require the encrypt module (an inconvenient requirement if the site doesn't need it otherwise)? Is it doing something with data which email field and contact module aren't doing?

Thank you

Comments

Pol’s picture

Status: Active » Fixed

Hi there,

Thanks for your message, it's cool, I didn't know that this module could be useful !

  1. The module uses the contact module to retrieve the contact form. See views_contact_form.form.inc
      // Load that page even if the module is not enabled.
      module_load_include('inc', 'contact', 'contact.pages');
      // Get Drupal's default contact form by default.
      $form = drupal_retrieve_form('contact_site_form', $form_state);
    

    You can override the form using hook_form_alter() if you want to as well.

  2. I didn't tried that yet but there is no reason it shouldn't be, if you try, could you give me some feedback so I can update the module front page.
  3. It requires the encrypt module to encode the destination email addresses into the form. I could use a hidden input field, but I don't like the idea that emails addresses could be found in the html source code. That's why I'm relying on the encrypt module to encode the data in a secure way.

Another though I have in mind: I think the idea behind this module could be extended to any form provided by Drupal, but I lack time to work on this now unfortunately.

Pol’s picture

Edit: I just tested with Captcha and Recaptcha module and it works perfectly ;-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

laskiyt’s picture

Title: Compatibility » Captcha Compatibility

Integration with the Captcha module is not working for me.

Views Contact Form is working perfectly (thank you!) but when I add a Captcha to the form it 1) displays below the "submit" button and 2) does not prevent the form from submitting if no answer or an incorrect answer is entered. I believe #1 is a Captcha issue and I've fixed it through doing a hook_form_alter and changing the Captcha's weight, but I mention it here in case it's related.

I believe issue #2 is a Views Contact Form issue because the Captcha works as intended on the other form I have on the site (a Webform).

Any ideas? What information can I provide here to make this easier to debug? Thanks!

laskiyt’s picture

Category: feature » bug
Status: Closed (fixed) » Active

Setting the status to active and the category to bug report.

Pol’s picture

Assigned: Unassigned » Pol
Category: bug » feature

Ok I will look at it.

Could you tell me which captcha module you're using ?

Thanks !

Pol’s picture

Category: feature » bug
Pol’s picture

Status: Active » Fixed

I got it working again, the form id to use is: views_contact_form_contact_form.

Reopen if you do not get it working.

laskiyt’s picture

Sorry to not have been more specific.

I'm using this Captcha module: https://drupal.org/project/captcha

I've got the Captcha showing up in the form (the form id for me is "views_form_member_contact_form_page", I guess it depends on what I named my contact form view). But the form will submit without checking the Captcha.

(If anyone is reading this later and is wondering how to know your form id, inspect the page where you have your form being displayed and it's the id on the html form element, except with underscores instead of dashes.)

Does leaving the Captcha blank prevent the form from submitting for you?

Thank you for your help and prompt responses.

laskiyt’s picture

Status: Fixed » Active
Pol’s picture

Version: 7.x-1.2 » 7.x-1.4
Status: Active » Fixed

Hello laskiyt,

I tried:

  1. A views block with a contact form,
  2. A views page with a contact form,
  3. Changed the formatter of an email field into a contact form,

And the captcha is still working as it should, I'm not able to reproduce the problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.