Ok here is my scenario.

I have the Taxonomy module enabled as well as Webform.
I created a vocabulary for Taxonomy and marked it as required and enabled it on the Webform content type.

I then proceed to create a Webform and fill in all the required information, as well as select a required Taxonomy term within the vocabulary I had created.
Then I click to add a component and after returning from the "add a component" screen the taxonomy term I had selected is now unselected and I have to choose it again.

So the problem seems to be after returning from adding a component it doesn't remember your Taxonomy term selection, making it very annoying having to select it every time you add a component.

Ok, I've tried to be as descriptive as possible, any ideas, updates or fixes for this are appreciated.
Thanks!!!

Comments

mandclu’s picture

Version: 5.x-1.x-dev » 5.x-1.8
Component: User interface » Code
Status: Active » Needs review

Just ran into the same thing, and was able to work out what appears to be a workable fix. I haven't tested it with taxonomies that accept multiple terms, I suspect it would require some tweaking to handle that. Anyway, here's what solved my problem.

In webform_prepare (in webform.module), under case t('Done'), the $node doesn't get rebuilt with the taxonomy in the structure necessary to be properly recognized. After the line that reads:

$node = (object)$edit;

I added the following lines:

      if (is_array($_POST['node']['taxonomy'])) {
		foreach ($_POST['node']['taxonomy'] as $tid => $vid) {
		  $tax_array = array('tid' => 2, 'vid' => 1);
		  $tax_terms[$tid] = (object) $tax_array;
		}
		$node->taxonomy = $tax_terms;
      }

That being said, for this to work properly with taxonomies that accept multiple terms, the $vid values would have to be nested one more level deep in the array. I suppose you could add a check in the code above if $vid was an array and step through it if that was the case.

quicksketch’s picture

Status: Needs review » Fixed

This was fixed by implementing fields in a separate tab: http://drupal.org/node/212951. This will be released in Webform 2.0.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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