From 2f6dada4817878bea5f410593b58a49d0fa8bf5f Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Wed, 17 Apr 2013 23:20:20 +0600 Subject: [PATCH] Fixes issue with ctor not setting default property --- .../umbraco/controls/ContentControl.cs | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs index b33ae42698..11e788d695 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs @@ -30,12 +30,6 @@ namespace umbraco.controls public class ContentControl : TabView { - public ContentControl() - { - //by default set this to true for content - SavePropertyDataWhenInvalid = true; - } - private readonly Content _content; private readonly ArrayList _dataFields = new ArrayList(); private UmbracoEnsuredPage _prntpage; @@ -51,7 +45,11 @@ namespace umbraco.controls private readonly CustomValidator _nameTxtCustomValidator = new CustomValidator(); private static readonly string UmbracoPath = SystemDirectories.Umbraco; public Pane PropertiesPane = new Pane(); - + // zb-00036 #29889 : load it only once + List _virtualTabs; + //default to true! + private bool _savePropertyDataWhenInvalid = true; + public Content ContentObject { get { return _content; } @@ -68,7 +66,11 @@ namespace umbraco.controls /// to the database when the page is invalid because there is no published state. /// Relates to: http://issues.umbraco.org/issue/U4-227 /// - public bool SavePropertyDataWhenInvalid { get; set; } + public bool SavePropertyDataWhenInvalid + { + get { return _savePropertyDataWhenInvalid; } + set { _savePropertyDataWhenInvalid = value; } + } [Obsolete("This is no longer used and will be removed from the codebase in future versions")] private string _errorMessage = ""; @@ -84,9 +86,6 @@ namespace umbraco.controls { } - // zb-00036 #29889 : load it only once - List _virtualTabs; - /// /// Constructor to set default properties. ///