I ran into a situation where a) I was working from an installation profile with lots of things exported, like the 'webform_node_types' variable, b) I renamed the content type so it's something more appropriate for the use case rather than "webform". However, there's no way to not create the Webform content type, webform_install() automatically installs it. It would be useful if there was a super, secret, hidden way to make Webform not create the content type.

Comments

DamienMcKenna’s picture

StatusFileSize
new1.36 KB

Here's a patch for D7 that uses a new variable, "webform_create_content_type", that only lets the installer run if the variable is TRUE, which incidentally is the default. Limited use, but hopefully will help for a few use cases.

DamienMcKenna’s picture

Status:Active» Needs review
DamienMcKenna’s picture

StatusFileSize
new1.36 KB

A patch for D6.

quicksketch’s picture

Status:Needs review» Fixed

Thanks, although a crazy edge-case, I can see how I might want such a thing if I were building a distribution also.

I committed this patch but with a change. I renamed the variable to "webform_install_create_content_type", which is wildly verbose but having the word "install" in there makes it clear to me that this is something only needed during install.

Status:Fixed» Closed (fixed)

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

alisonjo2786’s picture

Hi all,

I'd really like to set this variable so Webform module won't create the default webform content type, but I can't figure out how to do so. I figure I'd put variable_set somewhere, but I don't know where, and I'm striking out with trial-and-error so far.

I have an install profile to work with, and a Feature with a custom content type, Webform as a dependency, and the webform_node_types variable (the content type is webform-enabled).

Thank you for your help!

DamienMcKenna’s picture

@alisonjo2786: Add this line to your site's settings.php:

<?php
$conf
['webform_install_create_content_type'] = FALSE;
?>

You could also use Drush:

drush vset webform_install_create_content_type FALSE

alisonjo2786’s picture

@DamienMcKenna -- thank you for your quick reply. that's so simple!! thanks!