From 9a856df8bc30590eb7c8e9cf6b38f7d604e3c2fb Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 25 Nov 2013 17:36:56 +1100 Subject: [PATCH] Fixes: U4-3644 Multiple Textstring DataType not displaying in DocType (vs. 7.0.0 build 183) --- .../multipletextbox/multipletextbox.html | 6 ++++-- .../MultipleTextStringPropertyEditor.cs | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html index 0aa0a86ed4..bcf8fdb004 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html @@ -5,13 +5,15 @@ - + - + + {{model | json}} + diff --git a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs index 1f2cfe55fe..cc6c0468a3 100644 --- a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs @@ -44,7 +44,7 @@ namespace Umbraco.Web.PropertyEditors }); Fields.Add(new PreValueField(new IntegerValidator()) { - Description = "Enter the maximum amount of text boxes to be displayed, enter -1 for unlimited", + Description = "Enter the maximum amount of text boxes to be displayed, enter 0 for unlimited", Key = "max", View = "requiredfield", Name = "Maximum" @@ -153,8 +153,13 @@ namespace Umbraco.Web.PropertyEditors .Where(x => x["value"] != null) .Select(x => x["value"].Value()); - //only allow the max - return string.Join(Environment.NewLine, array.Take(max)); + //only allow the max if over 0 + if (max > 0) + { + return string.Join(Environment.NewLine, array.Take(max)); + } + + return string.Join(Environment.NewLine, array); } ///