From 4fb1c18a7213ad3f09b3ac66ed43c15c0beefa6d Mon Sep 17 00:00:00 2001 From: Westley Harris Date: Tue, 15 Dec 2015 07:34:32 -0500 Subject: [PATCH] Update TaxonomyField.cshtml Re-submit of #6160. Fixed a bug in the taxonomy field editor template that allows you to click on "create some terms" for a non-existent taxonomy. This situation occurs when you assign a taxonomy field to a content type but do not specify a taxonomy. --- .../Views/EditorTemplates/Fields/TaxonomyField.cshtml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Views/EditorTemplates/Fields/TaxonomyField.cshtml b/src/Orchard.Web/Modules/Orchard.Taxonomies/Views/EditorTemplates/Fields/TaxonomyField.cshtml index 717f1dd5a..bdd8b2678 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Views/EditorTemplates/Fields/TaxonomyField.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Views/EditorTemplates/Fields/TaxonomyField.cshtml @@ -42,7 +42,9 @@ } - @if (!Model.Terms.Any() && AuthorizedFor(Orchard.Taxonomies.Permissions.CreateTerm)) { + @if (Model.TaxonomyId == 0) { +

@T("Your haven't specified a taxonomy for {0}", Model.DisplayName)

+ }else if (!Model.Terms.Any() && AuthorizedFor(Orchard.Taxonomies.Permissions.CreateTerm)) {
@T("There are no terms defined for {0} yet.", Model.DisplayName) @T("Create some terms")