Add Subtaxa exception for custom taxonomy (v5.4)
I just wanted to report a bug, which is a NullReferenceException on SaveChanges when adding a new Taxon to Subtaxa in a custom hierarchical taxonomy.
The workaround is to set the Taxonomy property on the new Taxon (this is not in described in the documentation examples). I experienced this problem with version 5.4.
Sample code:
teacherTaxon = taxonomyManager.CreateTaxon<HierarchicalTaxon>();
teacherTaxon.Taxonomy = teacherClassesTaxonomy;
// REQUIRED
teacherTaxon.Name = teacher.Username;
teacherTaxon.Title = teacher.TeacherName;
schoolTaxon.Subtaxa.Add(teacherTaxon);
taxonomyManager.SaveChanges();
Regards,
Gary