Enabling the 'sfweb2lead_webform' modules Salesforce Settings on multiple webform types

[Note: I see this is no longer an issue with the latest versions of the 'Salesforce Web-to-Lead Webform Data Integration' module (7.x.2.0). This is when used in conjuction with Webform 7.x-4.x. When the Webform module is enabled a new tab becomes available when you edit a content type, and you can enable it as a webform. The ability to enable Salesforce integration is available under the  Webform > Salesforce Web2Lead (/node/xx/webform/sfweb2lead_webform).]

There is an issue when using the 'sfweb2lead_webform' module on a webform other than the default webform content type. Basically the Salesforce Settings only show up on the default Webform content type.

Below is an image showing the Salesforce Settings when editing a default Webform.

The problem arises when you create a new content type and set it to also be a webform. Something you can do on the Webform settings page (/admin/config/content/webform). To enable the Saleforce functionality on a new Webform content type I ended up editing the 'sfweb2lead_webform.module' file (yes I know hacking modules isn't good practice).

Firstly I'll show the bits you will need to edit, and secondly what they will be once you've added your new webform content type. For this example lets say I have a new Webform content type with a machine name of 'download_form'.

function sfweb2lead_webform_form_alter(&$form, &$form_state, $form_id) {
  // Handle editing of webform nodes.
  if ($form_id == 'webform_node_form') {


function sfweb2lead_webform_node_delete($node) {
  if ($node->type == 'webform') {


function sfweb2lead_webform_node_load($nodes, $types) {
  foreach ($nodes as $node) {
    if ($node->type == 'webform') {


function _sfweb2lead_webform_update_node($node) {
  if ($node->type == 'webform') {

And here are the updates:

function sfweb2lead_webform_form_alter(&$form, &$form_state, $form_id) {
  // Handle editing of webform nodes.
  if ($form_id == 'webform_node_form' OR $form_id == 'download_form_node_form') {


function sfweb2lead_webform_node_delete($node) {
  if ($node->type == 'webform' || $node->type == 'download_form') {


function sfweb2lead_webform_node_load($nodes, $types) {
  foreach ($nodes as $node) {
    if ($node->type == 'webform' || $node->type == 'download_form') {


function _sfweb2lead_webform_update_node($node) {
  if ($node->type == 'webform' || $node->type == 'download_form') {
Drupal version: 
Justin Chevallier

Justin Chevallier

Avid Drupal site builder & user for +10 years.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.