New Enterprice Keywords not created in term store (with fix)

Sep 26, 2012 at 3:43 PM

When new enterprice keywords are added, the keywords are added to the TaxonomyHiddenList but are not added to the term store. Keywords created like this do not work with Metadata Navigation Filter (All tags) or search.

Following is a quick fix for this that enables the taxonomy control to create the missing terms during validation.

if (!string.IsNullOrEmpty(taxControl.Text))
/* ADDITION to BatchEdit.aspx.cs line 138*/
string taxErrorMessage = string.Empty;
// This is required to get new ent keywords to be created in the termstore. Without this keywords are created as invalid keywords in hidden tax list with ID 22222222-2222-2222-2222-222222222222.
bool taxValidationError = taxControl.Validate(out taxErrorMessage);
if (!taxValidationError)
// TODO: error
_fieldValues.Add(new KeyValuePair<Guid, string>(new Guid(taxControl.FieldId), taxControl.Text));