I get this:

Fatal error: Call to undefined function contact_site_page() in /.../modules/contact_form_on_node/contact_form_on_node.module on line 149

and this:
Notice: Undefined variable: enabledTypes in contact_form_on_node_node_view() (linea 141 di /....../modules/contact_form_on_node/contact_form_on_node.module).

after installing the module and trying to view a page node..

I set the module to display a site-wide contact form on a node (full view)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

franravi’s picture

contact_site_page() function no longer exists in contact module, for drupal 7. I suggest to call drupal_get_form('contact_site_form') instead.

About $enabledTypes, it just happens that this value is being assigned for only one case inside a switch, I suggest moving it out so it is available for all others. Check line 112 of contact_form_on_node.module to see what I am speaking about.

I am sorry I don't know how to write a patch for this, but even so, I am just suggesting where the problem may be. I hope this will be helpful.

liveflow’s picture

I have the same problem. WSOD after loading the node with contact form.

"Undefined variable: enabledTypes in contact_form_on_node_node_view() (linea 141 ..."
Add string "$enabledTypes = array();" in line 99 after function description.

Khumbu’s picture

anyone has a solution for this, can't seem to figure this one out...

thx

KirstenLangholz’s picture

@franravi

You suggestion at least let's us see the node, but no form anywhere....

oadaeh’s picture

Assigned: Unassigned » oadaeh
Status: Active » Needs review
FileSize
12.39 KB

Since this is the oldest issue that I believe is relevant, I'm posting here.

Attached is a patch that makes the 7.x-1.x version of this module with with Drupal 7.

It might apply to the 7.x-1.1 version, since it's mostly the same.

oadaeh’s picture

Title: Fatal error » Make module work with Drapul 7

Updating title.

royerd’s picture

The line of code:

<?php
print drupal_render($content['contact_form']["#value"])
?>

at the end of the node.tpl.php file works to get the form to appear at the bottom of the proper nodes, but it does not allow the option to "display link" only. Can that be fixed so that this will work (fully) in D7?

Metasequoia’s picture

I can't get this module to work with D7 (D7.15). No user's contact form below the designated content types... The patch from #5 is not working (error: patch does not apply) and with the solution in #8 I had no success, too.
Can someone who got this working explain the neccessary steps?

F8LERROR’s picture

Notice: Undefined index: page in contact_form_on_node_node_view() (line 114 of /home/content/18/9922718/html/sites/all/modules/contact_form_on_node/contact_form_on_node.module).

This is the error I get. Below is the line in question (114):

if (user_access('access user contact forms') && $enabledTypes[$node->type] != "0") {

my coding skills are VERY rusty to say the least, please any help is greatly appreciated.

oadaeh’s picture

There is now a public dev release that includes the patch I attached in #5 (and some other fixes and updates). Check it out and let me know what doesn't work.

I'll give it a few weeks, then I'll create a new stable release.

Khumbu’s picture

Did a quick test on a dev site and played with the settings.....everything seems to work.

Thanks and keep up the great work :)

espirates’s picture

I tried both the dev and regular release and neither is showing up in Drupal 7

oadaeh’s picture

@espirates, you will need to provide more information than that, if you want any help.

There are some guidelines, here: https://drupal.org/node/73179 (especially in the Issue Details section).

oadaeh’s picture

Status: Needs review » Fixed

It's been way more than a few weeks, but I've finally created a new stable release. Version 7.x-1.2 is now available.

oadaeh’s picture

I missed an issue. Version 7.x-1.3 is now available.

Status: Fixed » Closed (fixed)

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