Issue #6572: Add only existing terms for the field.

This commit is contained in:
Jeff
2016-03-11 11:49:31 +00:00
parent cbd2ae71e1
commit 244cb6c6f4

View File

@@ -63,8 +63,7 @@ namespace Orchard.Taxonomies.Drivers {
protected override DriverResult Editor(ContentPart part, TaxonomyField field, IUpdateModel updater, dynamic shapeHelper) {
// Initializing viewmodel using the terms that are already selected to prevent loosing them when updating an editor group this field isn't displayed in.
// Get all the selected, published terms of all the TaxonomyFields of the content item.
var appliedTerms = GetAppliedTerms(part).ToList();
var appliedTerms = GetAppliedTerms(part, field, VersionOptions.Latest).ToList();
var viewModel = new TaxonomyFieldViewModel { Terms = appliedTerms.Select(t => t.CreateTermEntry()).ToList() };
foreach (var item in viewModel.Terms) item.IsChecked = true;