U4-3710, -3732 - Fix default ShortStringHelper

This commit is contained in:
Stephan
2013-12-13 12:06:56 +01:00
parent 51da5343ea
commit 5aec753859
6 changed files with 734 additions and 604 deletions

View File

@@ -801,9 +801,11 @@ namespace Umbraco.Core
if (_helper != null)
return _helper;
// there *has* to be a short string helper, even if the resolver has not
// been initialized - used the default one with default configuration.
_helper = new DefaultShortStringHelper().WithConfig(allowLeadingDigits: true);
// we don't want Umbraco to die because the resolver hasn't been initialized
// as the ShortStringHelper is too important, so as long as it's not there
// already, we use a default one. That should never happen, but...
Logging.LogHelper.Warn<IShortStringHelper>("ShortStringHelperResolver.HasCurrent == false, fallback to default.");
_helper = new DefaultShortStringHelper().WithDefaultConfig();
_helper.Freeze();
return _helper;
}