Webform module allows to attach a webform to any content type selecting "Enable webform functionality" during the content type configuration.

By default, Webform workflow module only works with Webform content type, no with others. I've developed a patch to fix it.

With my patch, the Webform workflow module checks all content types with webform functionalities and allows the workflow for them, but when you enable the webform functionality in a new content type, you must uninstall/install Webform workflow module to allow workflow in it, maybe somebody would fix it... ;)

Comments

fcasanellas created an issue. See original summary.

joel_osc’s picture

Category: Feature request » Bug report
Status: Active » Needs review

I think this is a legitimate defect. Changing status, testing patch.

natew’s picture

Thank you for the module and the patch. I ran into this issue and the patch solved the problem.

I am using the webform_template module and created my own content type with webform enabled. I ended up adding the webform_workflow_states field manually and used the features module to make sure the field is added/deployed. This way I didn't need to uninstall and re-install to get the field instances. Which wasn't really an option for our setup.

laboratory.mike’s picture

Status: Needs review » Reviewed & tested by the community

I have tested the patch and it works as written.

pjcdawkins’s picture

Title: Workflow for all content types » Automatically enable Webform Workflow for all webform content types
Category: Bug report » Feature request
Status: Reviewed & tested by the community » Needs work

The problem isn't that the module doesn't support all webform content types. The problem is that the field instances are only created (automatically) on install, not at any other time.

The intended logic in the patch (finding webform content types and creating instances for each one) is already implemented in the webform_workflow_install() hook:

  module_load_include('inc', 'webform_workflow', 'includes/webform_workflow.field_instances');

  // Create default instances for nodes.
  foreach (webform_node_types() as $bundle) {
    foreach (_webform_workflow_node_field_instances() as $instance) {
      if (field_info_instance('node', $instance['field_name'], $bundle)) {
        continue;
      }
      $instance['bundle'] = $bundle;
      field_create_instance($instance);
    }
  }

After installing WW, it's still easy to add a field instance to a new Webform content type - you would use the normal Field UI. I'm not sure if (or when) that should be done automatically - users do not necessarily want WW on all their webforms.

fgjohnson@lojoh.ca’s picture

StatusFileSize
new898 bytes

Thought this should be better named.
Easier to find.