Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | webform-n1263584-d6.patch | 1.36 KB | DamienMcKenna |
#1 | webform-n1263584-d7.patch | 1.36 KB | DamienMcKenna |
Comments
Comment #1
DamienMcKennaHere'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.
Comment #2
DamienMcKennaComment #3
DamienMcKennaA patch for D6.
Comment #4
quicksketchThanks, 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.
Comment #6
alisonHi 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!
Comment #7
DamienMcKenna@alisonjo2786: Add this line to your site's settings.php:
You could also use Drush:
drush vset webform_install_create_content_type FALSE
Comment #8
alison@DamienMcKenna -- thank you for your quick reply. that's so simple!! thanks!