diff --git a/.github/V8_GETTING_STARTED.md b/.github/V8_GETTING_STARTED.md index 87ddbb166a..1cc33bb126 100644 --- a/.github/V8_GETTING_STARTED.md +++ b/.github/V8_GETTING_STARTED.md @@ -33,5 +33,5 @@ We recommend running the site with the Visual Studio since you'll be able to rem We are keeping track of [known issues and limitations here](http://issues.umbraco.org/issue/U4-11279). These line items will eventually be turned into actual tasks to be worked on. Feel free to help us keep this list updated if you find issues and even help fix some of these items. If there is a particular item you'd like to help fix please mention this on the task and we'll create a sub task for the item to continue discussion there. -There's [a list of tasks for v8 that haven't been completed](hhttps://github.com/umbraco/Umbraco-CMS/labels/release%2F8.0.0). If you are interested in helping out with any of these please mention this on the task. This list will be constantly updated as we begin to document and design some of the other tasks that still need to get done. +There's [a list of tasks for v8 that haven't been completed](https://github.com/umbraco/Umbraco-CMS/labels/release%2F8.0.0). If you are interested in helping out with any of these please mention this on the task. This list will be constantly updated as we begin to document and design some of the other tasks that still need to get done. diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs index 493eb33c82..109645cdd3 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs @@ -328,7 +328,7 @@ AND umbracoNode.id <> @id", // We check if the entity's own PropertyTypes has been modified and then also check // any of the property groups PropertyTypes has been modified. // This specifically tells us if any property type collections have changed. - if (entity.IsPropertyDirty("PropertyTypes") || entity.PropertyGroups.Any(x => x.IsPropertyDirty("PropertyTypes"))) + if (entity.IsPropertyDirty("PropertyTypes") || entity.PropertyTypes.Any(pt => pt.IsDirty())) { var dbPropertyTypes = Database.Fetch("WHERE contentTypeId = @Id", new { entity.Id }); var dbPropertyTypeAlias = dbPropertyTypes.Select(x => x.Id); diff --git a/src/Umbraco.Core/Services/Implement/MemberService.cs b/src/Umbraco.Core/Services/Implement/MemberService.cs index 5a644cfec1..e191493736 100644 --- a/src/Umbraco.Core/Services/Implement/MemberService.cs +++ b/src/Umbraco.Core/Services/Implement/MemberService.cs @@ -1033,7 +1033,7 @@ namespace Umbraco.Core.Services.Implement scope.WriteLock(Constants.Locks.MemberTree); var ids = _memberGroupRepository.GetMemberIds(usernames); _memberGroupRepository.AssignRoles(ids, roleNames); - scope.Events.Dispatch(AssignedRoles, this, new RolesEventArgs(ids, roleNames)); + scope.Events.Dispatch(AssignedRoles, this, new RolesEventArgs(ids, roleNames), nameof(AssignedRoles)); scope.Complete(); } } @@ -1050,7 +1050,7 @@ namespace Umbraco.Core.Services.Implement scope.WriteLock(Constants.Locks.MemberTree); var ids = _memberGroupRepository.GetMemberIds(usernames); _memberGroupRepository.DissociateRoles(ids, roleNames); - scope.Events.Dispatch(RemovedRoles, this, new RolesEventArgs(ids, roleNames)); + scope.Events.Dispatch(RemovedRoles, this, new RolesEventArgs(ids, roleNames), nameof(RemovedRoles)); scope.Complete(); } } @@ -1066,7 +1066,7 @@ namespace Umbraco.Core.Services.Implement { scope.WriteLock(Constants.Locks.MemberTree); _memberGroupRepository.AssignRoles(memberIds, roleNames); - scope.Events.Dispatch(AssignedRoles, this, new RolesEventArgs(memberIds, roleNames)); + scope.Events.Dispatch(AssignedRoles, this, new RolesEventArgs(memberIds, roleNames), nameof(AssignedRoles)); scope.Complete(); } } @@ -1082,7 +1082,7 @@ namespace Umbraco.Core.Services.Implement { scope.WriteLock(Constants.Locks.MemberTree); _memberGroupRepository.DissociateRoles(memberIds, roleNames); - scope.Events.Dispatch(RemovedRoles, this, new RolesEventArgs(memberIds, roleNames)); + scope.Events.Dispatch(RemovedRoles, this, new RolesEventArgs(memberIds, roleNames), nameof(RemovedRoles)); scope.Complete(); } } diff --git a/src/Umbraco.Examine/ContentValueSetBuilder.cs b/src/Umbraco.Examine/ContentValueSetBuilder.cs index 39ffab98d9..07e5e4565b 100644 --- a/src/Umbraco.Examine/ContentValueSetBuilder.cs +++ b/src/Umbraco.Examine/ContentValueSetBuilder.cs @@ -42,7 +42,7 @@ namespace Umbraco.Examine var values = new Dictionary> { {"icon", c.ContentType.Icon.Yield()}, - {UmbracoExamineIndexer.PublishedFieldName, new object[] {c.Published ? 1 : 0}}, //Always add invariant published value + {UmbracoExamineIndex.PublishedFieldName, new object[] {c.Published ? 1 : 0}}, //Always add invariant published value {"id", new object[] {c.Id}}, {"key", new object[] {c.Key}}, {"parentID", new object[] {c.Level > 1 ? c.ParentId : -1}}, @@ -61,12 +61,12 @@ namespace Umbraco.Examine {"writerName",(c.GetWriterProfile(_userService)?.Name ?? "??").Yield() }, {"writerID", new object[] {c.WriterId}}, {"template", new object[] {c.Template?.Id ?? 0}}, - {UmbracoContentIndexer.VariesByCultureFieldName, new object[] {0}}, + {UmbracoContentIndex.VariesByCultureFieldName, new object[] {0}}, }; if (isVariant) { - values[UmbracoContentIndexer.VariesByCultureFieldName] = new object[] { 1 }; + values[UmbracoContentIndex.VariesByCultureFieldName] = new object[] { 1 }; foreach (var culture in c.AvailableCultures) { @@ -76,7 +76,7 @@ namespace Umbraco.Examine values[$"nodeName_{lowerCulture}"] = PublishedValuesOnly ? c.GetPublishName(culture).Yield() : c.GetCultureName(culture).Yield(); - values[$"{UmbracoExamineIndexer.PublishedFieldName}_{lowerCulture}"] = (c.IsCulturePublished(culture) ? 1 : 0).Yield(); + values[$"{UmbracoExamineIndex.PublishedFieldName}_{lowerCulture}"] = (c.IsCulturePublished(culture) ? 1 : 0).Yield(); values[$"updateDate_{lowerCulture}"] = PublishedValuesOnly ? c.GetPublishDate(culture).Yield() : c.GetUpdateDate(culture).Yield(); diff --git a/src/Umbraco.Examine/ContentValueSetValidator.cs b/src/Umbraco.Examine/ContentValueSetValidator.cs index eabf15f672..d4f6ceb15f 100644 --- a/src/Umbraco.Examine/ContentValueSetValidator.cs +++ b/src/Umbraco.Examine/ContentValueSetValidator.cs @@ -92,18 +92,18 @@ namespace Umbraco.Examine //check for published content if (valueSet.Category == IndexTypes.Content && PublishedValuesOnly) { - if (!valueSet.Values.TryGetValue(UmbracoExamineIndexer.PublishedFieldName, out var published)) + if (!valueSet.Values.TryGetValue(UmbracoExamineIndex.PublishedFieldName, out var published)) return ValueSetValidationResult.Failed; if (!published[0].Equals(1)) return ValueSetValidationResult.Failed; //deal with variants, if there are unpublished variants than we need to remove them from the value set - if (valueSet.Values.TryGetValue(UmbracoContentIndexer.VariesByCultureFieldName, out var variesByCulture) + if (valueSet.Values.TryGetValue(UmbracoContentIndex.VariesByCultureFieldName, out var variesByCulture) && variesByCulture.Count > 0 && variesByCulture[0].Equals(1)) { //so this valueset is for a content that varies by culture, now check for non-published cultures and remove those values - foreach(var publishField in valueSet.Values.Where(x => x.Key.StartsWith($"{UmbracoExamineIndexer.PublishedFieldName}_")).ToList()) + foreach(var publishField in valueSet.Values.Where(x => x.Key.StartsWith($"{UmbracoExamineIndex.PublishedFieldName}_")).ToList()) { if (publishField.Value.Count <= 0 || !publishField.Value[0].Equals(1)) { diff --git a/src/Umbraco.Examine/Umbraco.Examine.csproj b/src/Umbraco.Examine/Umbraco.Examine.csproj index 9194d8332d..0aedf6e754 100644 --- a/src/Umbraco.Examine/Umbraco.Examine.csproj +++ b/src/Umbraco.Examine/Umbraco.Examine.csproj @@ -83,12 +83,12 @@ - + - + - + Properties\SolutionInfo.cs diff --git a/src/Umbraco.Examine/UmbracoContentIndexer.cs b/src/Umbraco.Examine/UmbracoContentIndex.cs similarity index 97% rename from src/Umbraco.Examine/UmbracoContentIndexer.cs rename to src/Umbraco.Examine/UmbracoContentIndex.cs index 0501fe90c6..910941ea7b 100644 --- a/src/Umbraco.Examine/UmbracoContentIndexer.cs +++ b/src/Umbraco.Examine/UmbracoContentIndex.cs @@ -21,7 +21,7 @@ namespace Umbraco.Examine /// /// An indexer for Umbraco content and media /// - public class UmbracoContentIndexer : UmbracoExamineIndexer + public class UmbracoContentIndex : UmbracoExamineIndex { public const string VariesByCultureFieldName = SpecialFieldPrefix + "VariesByCulture"; protected ILocalizationService LanguageService { get; } @@ -32,7 +32,7 @@ namespace Umbraco.Examine /// Constructor for configuration providers /// [EditorBrowsable(EditorBrowsableState.Never)] - public UmbracoContentIndexer() + public UmbracoContentIndex() { LanguageService = Current.Services.LocalizationService; @@ -50,7 +50,7 @@ namespace Umbraco.Examine /// /// /// - public UmbracoContentIndexer( + public UmbracoContentIndex( string name, IEnumerable fieldDefinitions, Directory luceneDirectory, @@ -167,7 +167,7 @@ namespace Umbraco.Examine //since the path is not valid we need to delete this item in case it exists in the index already and has now //been moved to an invalid parent. foreach (var i in group) - QueueIndexOperation(new IndexOperation(new ValueSet(i.Id), IndexOperationType.Delete)); + base.PerformDeleteFromIndex(i.Id, args => { /*noop*/ }); } else { diff --git a/src/Umbraco.Examine/UmbracoExamineIndexer.cs b/src/Umbraco.Examine/UmbracoExamineIndex.cs similarity index 98% rename from src/Umbraco.Examine/UmbracoExamineIndexer.cs rename to src/Umbraco.Examine/UmbracoExamineIndex.cs index 84c8a7d8c5..15f1a75955 100644 --- a/src/Umbraco.Examine/UmbracoExamineIndexer.cs +++ b/src/Umbraco.Examine/UmbracoExamineIndex.cs @@ -23,7 +23,7 @@ namespace Umbraco.Examine /// An abstract provider containing the basic functionality to be able to query against /// Umbraco data. /// - public abstract class UmbracoExamineIndexer : LuceneIndex, IUmbracoIndexer, IIndexDiagnostics + public abstract class UmbracoExamineIndex : LuceneIndex, IUmbracoIndexer, IIndexDiagnostics { // note // wrapping all operations that end up calling base.SafelyProcessQueueItems in a safe call @@ -48,7 +48,7 @@ namespace Umbraco.Examine /// Constructor for config provider based indexes /// [EditorBrowsable(EditorBrowsableState.Never)] - protected UmbracoExamineIndexer() + protected UmbracoExamineIndex() : base() { ProfilingLogger = Current.ProfilingLogger; @@ -56,7 +56,7 @@ namespace Umbraco.Examine } /// - /// Create a new + /// Create a new /// /// /// @@ -65,7 +65,7 @@ namespace Umbraco.Examine /// /// /// - protected UmbracoExamineIndexer( + protected UmbracoExamineIndex( string name, IEnumerable fieldDefinitions, Directory luceneDirectory, diff --git a/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs b/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs index 0812d93931..227b52e085 100644 --- a/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs +++ b/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs @@ -9,10 +9,10 @@ namespace Umbraco.Examine { public class UmbracoExamineIndexDiagnostics : IIndexDiagnostics { - private readonly UmbracoExamineIndexer _index; + private readonly UmbracoExamineIndex _index; private readonly ILogger _logger; - public UmbracoExamineIndexDiagnostics(UmbracoExamineIndexer index, ILogger logger) + public UmbracoExamineIndexDiagnostics(UmbracoExamineIndex index, ILogger logger) { _index = index; _logger = logger; @@ -28,7 +28,7 @@ namespace Umbraco.Examine } catch (AlreadyClosedException) { - _logger.Warn(typeof(UmbracoContentIndexer), "Cannot get GetIndexDocumentCount, the writer is already closed"); + _logger.Warn(typeof(UmbracoContentIndex), "Cannot get GetIndexDocumentCount, the writer is already closed"); return 0; } } @@ -44,7 +44,7 @@ namespace Umbraco.Examine } catch (AlreadyClosedException) { - _logger.Warn(typeof(UmbracoContentIndexer), "Cannot get GetIndexFieldCount, the writer is already closed"); + _logger.Warn(typeof(UmbracoContentIndex), "Cannot get GetIndexFieldCount, the writer is already closed"); return 0; } } @@ -62,15 +62,15 @@ namespace Umbraco.Examine { var d = new Dictionary { - [nameof(UmbracoExamineIndexer.CommitCount)] = _index.CommitCount, - [nameof(UmbracoExamineIndexer.DefaultAnalyzer)] = _index.DefaultAnalyzer.GetType().Name, - [nameof(UmbracoExamineIndexer.DirectoryFactory)] = _index.DirectoryFactory, - [nameof(UmbracoExamineIndexer.EnableDefaultEventHandler)] = _index.EnableDefaultEventHandler, - [nameof(UmbracoExamineIndexer.LuceneIndexFolder)] = + [nameof(UmbracoExamineIndex.CommitCount)] = _index.CommitCount, + [nameof(UmbracoExamineIndex.DefaultAnalyzer)] = _index.DefaultAnalyzer.GetType().Name, + [nameof(UmbracoExamineIndex.DirectoryFactory)] = _index.DirectoryFactory, + [nameof(UmbracoExamineIndex.EnableDefaultEventHandler)] = _index.EnableDefaultEventHandler, + [nameof(UmbracoExamineIndex.LuceneIndexFolder)] = _index.LuceneIndexFolder == null ? string.Empty : _index.LuceneIndexFolder.ToString().ToLowerInvariant().TrimStart(IOHelper.MapPath(SystemDirectories.Root).ToLowerInvariant()).Replace("\\", "/").EnsureStartsWith('/'), - [nameof(UmbracoExamineIndexer.PublishedValuesOnly)] = _index.PublishedValuesOnly, + [nameof(UmbracoExamineIndex.PublishedValuesOnly)] = _index.PublishedValuesOnly, //There's too much info here //[nameof(UmbracoExamineIndexer.FieldDefinitionCollection)] = _index.FieldDefinitionCollection, }; diff --git a/src/Umbraco.Examine/UmbracoMemberIndexer.cs b/src/Umbraco.Examine/UmbracoMemberIndex.cs similarity index 95% rename from src/Umbraco.Examine/UmbracoMemberIndexer.cs rename to src/Umbraco.Examine/UmbracoMemberIndex.cs index 4943f49825..28b46f72dd 100644 --- a/src/Umbraco.Examine/UmbracoMemberIndexer.cs +++ b/src/Umbraco.Examine/UmbracoMemberIndex.cs @@ -22,13 +22,13 @@ namespace Umbraco.Examine /// /// Custom indexer for members /// - public class UmbracoMemberIndexer : UmbracoExamineIndexer + public class UmbracoMemberIndex : UmbracoExamineIndex { /// /// Constructor for config/provider based indexes /// [EditorBrowsable(EditorBrowsableState.Never)] - public UmbracoMemberIndexer() + public UmbracoMemberIndex() { } @@ -41,7 +41,7 @@ namespace Umbraco.Examine /// /// /// - public UmbracoMemberIndexer( + public UmbracoMemberIndex( string name, IEnumerable fieldDefinitions, Directory luceneDirectory, diff --git a/src/Umbraco.Tests/Composing/TypeFinderTests.cs b/src/Umbraco.Tests/Composing/TypeFinderTests.cs index 955f6f94c8..9b52546dff 100644 --- a/src/Umbraco.Tests/Composing/TypeFinderTests.cs +++ b/src/Umbraco.Tests/Composing/TypeFinderTests.cs @@ -49,7 +49,7 @@ namespace Umbraco.Tests.Composing //typeof(TabPage).Assembly, typeof(System.Web.Mvc.ActionResult).Assembly, typeof(TypeFinder).Assembly, - typeof(global::Umbraco.Examine.UmbracoExamineIndexer).Assembly + typeof(global::Umbraco.Examine.UmbracoExamineIndex).Assembly }; } diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs index 1f849fc1ce..cbd335a6c4 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs @@ -146,7 +146,7 @@ namespace Umbraco.Tests.UmbracoExamine return mediaTypeServiceMock.Object; } - public static UmbracoContentIndexer GetUmbracoIndexer( + public static UmbracoContentIndex GetUmbracoIndexer( ProfilingLogger profilingLogger, Directory luceneDir, Analyzer analyzer = null, @@ -162,9 +162,9 @@ namespace Umbraco.Tests.UmbracoExamine if (validator == null) validator = new ContentValueSetValidator(true); - var i = new UmbracoContentIndexer( + var i = new UmbracoContentIndex( "testIndexer", - UmbracoExamineIndexer.UmbracoIndexFieldDefinitions, + UmbracoExamineIndex.UmbracoIndexFieldDefinitions, luceneDir, analyzer, profilingLogger, diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs index 29abfb9234..35e3524459 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs @@ -114,8 +114,8 @@ namespace Umbraco.Tests.UmbracoExamine Assert.AreEqual("value2", result.AllValues["grid.row1"][1]); Assert.IsTrue(result.Values.ContainsKey("grid")); Assert.AreEqual("value1 value2 ", result["grid"]); - Assert.IsTrue(result.Values.ContainsKey($"{UmbracoExamineIndexer.RawFieldPrefix}grid")); - Assert.AreEqual(json, result[$"{UmbracoExamineIndexer.RawFieldPrefix}grid"]); + Assert.IsTrue(result.Values.ContainsKey($"{UmbracoExamineIndex.RawFieldPrefix}grid")); + Assert.AreEqual(json, result[$"{UmbracoExamineIndex.RawFieldPrefix}grid"]); } } diff --git a/src/Umbraco.Tests/UmbracoExamine/UmbracoContentValueSetValidatorTests.cs b/src/Umbraco.Tests/UmbracoExamine/UmbracoContentValueSetValidatorTests.cs index 934dd34503..8d7a446ccb 100644 --- a/src/Umbraco.Tests/UmbracoExamine/UmbracoContentValueSetValidatorTests.cs +++ b/src/Umbraco.Tests/UmbracoExamine/UmbracoContentValueSetValidatorTests.cs @@ -179,7 +179,7 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoExamineIndexer.PublishedFieldName] = 1 + [UmbracoExamineIndex.PublishedFieldName] = 1 })); Assert.AreEqual(ValueSetValidationResult.Valid, result); } @@ -213,7 +213,7 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoExamineIndexer.PublishedFieldName] = 0 + [UmbracoExamineIndex.PublishedFieldName] = 0 })); Assert.AreEqual(ValueSetValidationResult.Failed, result); @@ -222,7 +222,7 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoExamineIndexer.PublishedFieldName] = 1 + [UmbracoExamineIndex.PublishedFieldName] = 1 })); Assert.AreEqual(ValueSetValidationResult.Valid, result); } @@ -237,8 +237,8 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoContentIndexer.VariesByCultureFieldName] = 1, - [UmbracoExamineIndexer.PublishedFieldName] = 0 + [UmbracoContentIndex.VariesByCultureFieldName] = 1, + [UmbracoExamineIndex.PublishedFieldName] = 0 })); Assert.AreEqual(ValueSetValidationResult.Failed, result); @@ -247,8 +247,8 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoContentIndexer.VariesByCultureFieldName] = 1, - [UmbracoExamineIndexer.PublishedFieldName] = 1 + [UmbracoContentIndex.VariesByCultureFieldName] = 1, + [UmbracoExamineIndex.PublishedFieldName] = 1 })); Assert.AreEqual(ValueSetValidationResult.Valid, result); @@ -257,17 +257,17 @@ namespace Umbraco.Tests.UmbracoExamine { ["hello"] = "world", ["path"] = "-1,555", - [UmbracoContentIndexer.VariesByCultureFieldName] = 1, - [$"{UmbracoExamineIndexer.PublishedFieldName}_en-us"] = 1, + [UmbracoContentIndex.VariesByCultureFieldName] = 1, + [$"{UmbracoExamineIndex.PublishedFieldName}_en-us"] = 1, ["hello_en-us"] = "world", ["title_en-us"] = "my title", - [$"{UmbracoExamineIndexer.PublishedFieldName}_es-es"] = 0, + [$"{UmbracoExamineIndex.PublishedFieldName}_es-es"] = 0, ["hello_es-ES"] = "world", ["title_es-ES"] = "my title", - [UmbracoExamineIndexer.PublishedFieldName] = 1 + [UmbracoExamineIndex.PublishedFieldName] = 1 }); Assert.AreEqual(10, valueSet.Values.Count()); - Assert.IsTrue(valueSet.Values.ContainsKey($"{UmbracoExamineIndexer.PublishedFieldName}_es-es")); + Assert.IsTrue(valueSet.Values.ContainsKey($"{UmbracoExamineIndex.PublishedFieldName}_es-es")); Assert.IsTrue(valueSet.Values.ContainsKey("hello_es-ES")); Assert.IsTrue(valueSet.Values.ContainsKey("title_es-ES")); @@ -275,7 +275,7 @@ namespace Umbraco.Tests.UmbracoExamine Assert.AreEqual(ValueSetValidationResult.Filtered, result); Assert.AreEqual(7, valueSet.Values.Count()); //filtered to 7 values (removes es-es values) - Assert.IsFalse(valueSet.Values.ContainsKey($"{UmbracoExamineIndexer.PublishedFieldName}_es-es")); + Assert.IsFalse(valueSet.Values.ContainsKey($"{UmbracoExamineIndex.PublishedFieldName}_es-es")); Assert.IsFalse(valueSet.Values.ContainsKey("hello_es-ES")); Assert.IsFalse(valueSet.Values.ContainsKey("title_es-ES")); } diff --git a/src/Umbraco.Web.UI.Client/lib/markdown/markdown.css b/src/Umbraco.Web.UI.Client/lib/markdown/markdown.css index 45c9b39c48..5594f70634 100644 --- a/src/Umbraco.Web.UI.Client/lib/markdown/markdown.css +++ b/src/Umbraco.Web.UI.Client/lib/markdown/markdown.css @@ -26,6 +26,11 @@ width: 100%; } +/* unset the negative margin applied in button-groups.less to avoid flickering when hovering the button bar */ +.wmd-panel .btn-toolbar .btn-group>.btn+.btn { + margin-left: 0; +} + /* .icon-link, .icon-blockquote, diff --git a/src/Umbraco.Web.UI.Client/lib/markdown/markdown.editor.js b/src/Umbraco.Web.UI.Client/lib/markdown/markdown.editor.js index 21ad5d0a8b..e1617d8365 100644 --- a/src/Umbraco.Web.UI.Client/lib/markdown/markdown.editor.js +++ b/src/Umbraco.Web.UI.Client/lib/markdown/markdown.editor.js @@ -1390,7 +1390,7 @@ "Redo - Ctrl+Y" : "Redo - Ctrl+Shift+Z"; // mac and other non-Windows platforms - buttons.redo = makeButton("wmd-redo-button", redoTitle, "icon-share-alt", null, group4); + buttons.redo = makeButton("wmd-redo-button", redoTitle, "icon-redo", null, group4); buttons.redo.execute = function (manager) { if (manager) manager.redo(); }; if (helpOptions) { @@ -2107,4 +2107,4 @@ } -})(); \ No newline at end of file +})(); diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/events/events.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/events/events.directive.js index 21980be925..a6a5336af0 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/events/events.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/events/events.directive.js @@ -3,54 +3,6 @@ **/ angular.module('umbraco.directives') -.directive('onKeyup', function () { - return { - link: function (scope, elm, attrs) { - var f = function () { - scope.$apply(attrs.onKeyup); - }; - elm.on("keyup", f); - scope.$on("$destroy", function(){ elm.off("keyup", f);} ); - } - }; -}) - -.directive('onKeydown', function () { - return { - link: function (scope, elm, attrs) { - var f = function () { - scope.$apply(attrs.onKeydown); - }; - elm.on("keydown", f); - scope.$on("$destroy", function(){ elm.off("keydown", f);} ); - } - }; -}) - -.directive('onBlur', function () { - return { - link: function (scope, elm, attrs) { - var f = function () { - scope.$apply(attrs.onBlur); - }; - elm.on("blur", f); - scope.$on("$destroy", function(){ elm.off("blur", f);} ); - } - }; -}) - -.directive('onFocus', function () { - return { - link: function (scope, elm, attrs) { - var f = function () { - scope.$apply(attrs.onFocus); - }; - elm.on("focus", f); - scope.$on("$destroy", function(){ elm.off("focus", f);} ); - } - }; -}) - .directive('onDragEnter', function () { return { link: function (scope, elm, attrs) { diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html index f6a641f2af..f14fb364ab 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html @@ -32,11 +32,11 @@
- + - + diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js index c7a46c4c4a..a274c25287 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js @@ -4,9 +4,12 @@ angular.module("umbraco") function($scope, mediaResource, entityResource, mediaHelper, mediaTypeHelper, eventsService, treeService, localStorageService, localizationService, editorService) { if (!$scope.model.title) { - localizationService.localize("defaultdialogs_selectMedia") - .then(function(data){ - $scope.model.title = data; + localizationService.localizeMany(["defaultdialogs_selectMedia", "general_includeFromsubFolders"]) + .then(function (data) { + $scope.labels = { + title: data[0], + includeSubFolders: data[1] + } }); } @@ -113,10 +116,10 @@ angular.module("umbraco") }; $scope.submitFolder = function() { - if ($scope.newFolderName) { + if ($scope.model.newFolderName) { $scope.creatingFolder = true; mediaResource - .addFolder($scope.newFolderName, $scope.currentFolder.id) + .addFolder($scope.model.newFolderName, $scope.currentFolder.id) .then(function(data) { //we've added a new folder so lets clear the tree cache for that specific item treeService.clearCache({ @@ -126,7 +129,7 @@ angular.module("umbraco") $scope.creatingFolder = false; $scope.gotoFolder(data); $scope.showFolderInput = false; - $scope.newFolderName = ""; + $scope.model.newFolderName = ""; }); } else { $scope.showFolderInput = false; diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html index 5046088d28..3bb694cac6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.html @@ -68,8 +68,8 @@ - +
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html index 31ea24b581..c0490a1707 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html @@ -65,7 +65,7 @@ ng-disabled="tab.inherited" umb-auto-focus umb-auto-resize - on-focus="activateGroup(tab)" + ng-focus="activateGroup(tab)" required val-server-field="{{'Groups[' + $index + '].Name'}}" /> @@ -87,7 +87,7 @@
- +
@@ -121,7 +121,7 @@ hotkey="alt+shift+p" hotkey-when="{{tab.tabState === 'active' && property.propertyState=='init'}}" ng-click="addProperty(property, tab)" - on-focus="activateGroup(tab)" + ng-focus="activateGroup(tab)" focus-when="{{property.focus}}"> diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-locked-field.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-locked-field.html index 56c5be6fb2..d13474d221 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-locked-field.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-locked-field.html @@ -24,7 +24,7 @@ title="{{ngModel}}" focus-when="{{!locked}}" umb-select-when="{{!locked}}" - on-blur="lock()" /> + ng-blur="lock()" />
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js index 2642a79ac7..a1e74cc207 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.copy.controller.js @@ -25,11 +25,11 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.CopyController", $scope.treeModel.hideHeader = userData.startContentIds.length > 0 && userData.startContentIds.indexOf(-1) == -1; }); - var node = $scope.currentNode; + $scope.source = _.clone($scope.currentNode); function treeLoadedHandler(args) { - if (node && node.path) { - $scope.dialogTreeApi.syncTree({ path: node.path, activate: false }); + if ($scope.source && $scope.source.path) { + $scope.dialogTreeApi.syncTree({ path: $scope.source.path, activate: false }); } } @@ -107,7 +107,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.CopyController", $scope.busy = true; $scope.error = false; - contentResource.copy({ parentId: $scope.target.id, id: node.id, relateToOriginal: $scope.relateToOriginal, recursive: $scope.recursive }) + contentResource.copy({ parentId: $scope.target.id, id: $scope.source.id, relateToOriginal: $scope.relateToOriginal, recursive: $scope.recursive }) .then(function (path) { $scope.error = false; $scope.success = true; diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js index a593bbad24..5dceff2571 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.move.controller.js @@ -22,11 +22,11 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.MoveController", $scope.treeModel.hideHeader = userData.startContentIds.length > 0 && userData.startContentIds.indexOf(-1) == -1; }); - var node = $scope.currentNode; + $scope.source = _.clone($scope.currentNode); function treeLoadedHandler(args) { - if (node && node.path) { - $scope.dialogTreeApi.syncTree({ path: node.path, activate: false }); + if ($scope.source && $scope.source.path) { + $scope.dialogTreeApi.syncTree({ path: $scope.source.path, activate: false }); } } @@ -84,7 +84,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.MoveController", $scope.busy = true; $scope.error = false; - contentResource.move({ parentId: $scope.target.id, id: node.id }) + contentResource.move({ parentId: $scope.target.id, id: $scope.source.id }) .then(function (path) { $scope.error = false; $scope.success = true; diff --git a/src/Umbraco.Web.UI.Client/src/views/content/copy.html b/src/Umbraco.Web.UI.Client/src/views/content/copy.html index 03a024c439..8f6d5d3e6d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/copy.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/copy.html @@ -11,14 +11,14 @@
- {{currentNode.name}} was copied to + {{source.name}} was copied to {{target.name}}
- +

- Choose where to copy {{currentNode.name}} to in the tree structure below + Choose where to copy {{source.name}} to in the tree structure below

diff --git a/src/Umbraco.Web.UI.Client/src/views/content/move.html b/src/Umbraco.Web.UI.Client/src/views/content/move.html index 708c3d3f82..b655917f6f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/move.html @@ -11,14 +11,14 @@
- {{currentNode.name}} was moved underneath {{target.name}} + {{source.name}} was moved underneath {{target.name}}
- +

Choose where to move - {{currentNode.name}} + {{source.name}} to in the tree structure below

diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js index c5ff80b7fb..8bb1dc3ac8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/media/media.move.controller.js @@ -3,7 +3,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController", function ($scope, userService, eventsService, mediaResource, appState, treeService, navigationService) { $scope.dialogTreeApi = {}; - var node = $scope.currentNode; + $scope.source = _.clone($scope.currentNode); $scope.treeModel = { hideHeader: false @@ -13,8 +13,8 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController", }); function treeLoadedHandler(args) { - if (node && node.path) { - $scope.dialogTreeApi.syncTree({ path: node.path, activate: false }); + if ($scope.source && $scope.source.path) { + $scope.dialogTreeApi.syncTree({ path: $scope.source.path, activate: false }); } } @@ -55,7 +55,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController", $scope.move = function () { $scope.busy = true; - mediaResource.move({ parentId: $scope.target.id, id: node.id }) + mediaResource.move({ parentId: $scope.target.id, id: $scope.source.id }) .then(function (path) { $scope.busy = false; $scope.error = false; diff --git a/src/Umbraco.Web.UI.Client/src/views/media/move.html b/src/Umbraco.Web.UI.Client/src/views/media/move.html index 6d93eb4e22..451acbdb16 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/move.html +++ b/src/Umbraco.Web.UI.Client/src/views/media/move.html @@ -11,14 +11,14 @@
- {{currentNode.name}} was moved underneath {{target.name}} + {{source.name}} was moved underneath {{target.name}}
- +

Choose where to move - {{currentNode.name}} + {{source.name}} to in the tree structure below

diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js index 704fccbde1..62099734fb 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js @@ -131,6 +131,7 @@ function dateTimePickerController($scope, notificationsService, assetsService, a else { $scope.model.value = null; } + angularHelper.getCurrentForm($scope).$setDirty(); } /** Sets the value of the date picker control adn associated viewModel objects based on the model value */ diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js index 639c24f54c..b3c014f54a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js @@ -8,6 +8,10 @@ function MarkdownEditorController($scope, $element, assetsService, editorService $scope.model.value = $scope.model.config.defaultValue; } + // create a unique ID for the markdown editor, so the button bar bindings can handle split view + // - must be bound on scope, not scope.model - otherwise it won't work, because $scope.model is used in both sides of the split view + $scope.editorId = $scope.model.alias + _.uniqueId("-"); + function openMediaPicker(callback) { var mediaPicker = { disableFolderSelect: true, @@ -40,7 +44,7 @@ function MarkdownEditorController($scope, $element, assetsService, editorService $timeout(function () { $scope.markdownEditorInitComplete = false; var converter2 = new Markdown.Converter(); - var editor2 = new Markdown.Editor(converter2, "-" + $scope.model.alias); + var editor2 = new Markdown.Editor(converter2, "-" + $scope.editorId); editor2.run(); //subscribe to the image dialog clicks diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.html index 9b8f44317a..68fc86f002 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.html @@ -1,8 +1,8 @@
-
+
- + -
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js index c8813ee4c0..515eddf0a3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js @@ -1,4 +1,4 @@ -function sliderController($scope) { +function sliderController($scope, angularHelper) { let sliderRef = null; @@ -14,13 +14,14 @@ function setModelValue(values) { $scope.model.value = values ? values.toString() : null; + angularHelper.getCurrentForm($scope).$setDirty(); } $scope.setup = function(slider) { sliderRef = slider; }; - $scope.end = function(values) { + $scope.change = function (values) { setModelValue(values); }; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html index c147b30b23..ea0c2ef7bc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.html @@ -5,7 +5,7 @@ ng-model="sliderValue" options="sliderOptions" on-setup="setup(slider)" - on-end="end(values)"> + on-change="change(values)">
diff --git a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs index 3e42178fbd..ea76293df5 100644 --- a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs @@ -123,15 +123,15 @@ namespace Umbraco.Web.Models.Mapping .AfterMap((src, dest) => { //get the icon if there is one - dest.Icon = src.Values.ContainsKey(UmbracoExamineIndexer.IconFieldName) - ? src.Values[UmbracoExamineIndexer.IconFieldName] + dest.Icon = src.Values.ContainsKey(UmbracoExamineIndex.IconFieldName) + ? src.Values[UmbracoExamineIndex.IconFieldName] : "icon-document"; dest.Name = src.Values.ContainsKey("nodeName") ? src.Values["nodeName"] : "[no name]"; - if (src.Values.ContainsKey(UmbracoExamineIndexer.NodeKeyFieldName)) + if (src.Values.ContainsKey(UmbracoExamineIndex.NodeKeyFieldName)) { Guid key; - if (Guid.TryParse(src.Values[UmbracoExamineIndexer.NodeKeyFieldName], out key)) + if (Guid.TryParse(src.Values[UmbracoExamineIndex.NodeKeyFieldName], out key)) { dest.Key = key; @@ -166,7 +166,7 @@ namespace Umbraco.Web.Models.Mapping dest.ParentId = -1; } } - dest.Path = src.Values.ContainsKey(UmbracoExamineIndexer.IndexPathFieldName) ? src.Values[UmbracoExamineIndexer.IndexPathFieldName] : ""; + dest.Path = src.Values.ContainsKey(UmbracoExamineIndex.IndexPathFieldName) ? src.Values[UmbracoExamineIndex.IndexPathFieldName] : ""; if (src.Values.ContainsKey(LuceneIndex.ItemTypeFieldName)) { diff --git a/src/Umbraco.Web/Models/Trees/MenuItemList.cs b/src/Umbraco.Web/Models/Trees/MenuItemList.cs index b34f0b4444..70b35e25bd 100644 --- a/src/Umbraco.Web/Models/Trees/MenuItemList.cs +++ b/src/Umbraco.Web/Models/Trees/MenuItemList.cs @@ -44,10 +44,11 @@ namespace Umbraco.Web.Models.Trees /// /// /// The text to display for the menu item, will default to the IAction alias if not specified - public MenuItem Add(string name, bool hasSeparator = false) + /// Whether or not this action opens a dialog + public MenuItem Add(string name, bool hasSeparator = false, bool opensDialog = false) where T : IAction { - var item = CreateMenuItem(name, hasSeparator); + var item = CreateMenuItem(name, hasSeparator, opensDialog); if (item != null) { Add(item); @@ -62,11 +63,11 @@ namespace Umbraco.Web.Models.Trees /// /// /// The used to localize the action name based on it's alias - /// + /// Whether or not this action opens a dialog public MenuItem Add(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false) where T : IAction { - var item = CreateMenuItem(textService, hasSeparator); + var item = CreateMenuItem(textService, hasSeparator, opensDialog); if (item != null) { Add(item); @@ -75,14 +76,15 @@ namespace Umbraco.Web.Models.Trees return null; } - internal MenuItem CreateMenuItem(string name, bool hasSeparator = false) + internal MenuItem CreateMenuItem(string name, bool hasSeparator = false, bool opensDialog = false) where T : IAction { var item = Current.Actions.GetAction(); if (item == null) return null; var menuItem = new MenuItem(item, name) { - SeperatorBefore = hasSeparator + SeperatorBefore = hasSeparator, + OpensDialog = opensDialog }; return menuItem; diff --git a/src/Umbraco.Web/PropertyEditors/GridPropertyIndexValueFactory.cs b/src/Umbraco.Web/PropertyEditors/GridPropertyIndexValueFactory.cs index c8235d1d11..83279ae975 100644 --- a/src/Umbraco.Web/PropertyEditors/GridPropertyIndexValueFactory.cs +++ b/src/Umbraco.Web/PropertyEditors/GridPropertyIndexValueFactory.cs @@ -59,7 +59,7 @@ namespace Umbraco.Web.PropertyEditors if (sb.Length > 0) { //First save the raw value to a raw field - result.Add(new KeyValuePair>($"{UmbracoExamineIndexer.RawFieldPrefix}{property.Alias}", new[] { rawVal })); + result.Add(new KeyValuePair>($"{UmbracoExamineIndex.RawFieldPrefix}{property.Alias}", new[] { rawVal })); //index the property with the combined/cleaned value result.Add(new KeyValuePair>(property.Alias, new[] { sb.ToString() })); diff --git a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs index 2deb8b8444..31b65c6357 100644 --- a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs @@ -104,7 +104,7 @@ namespace Umbraco.Web.PropertyEditors //index the stripped html values yield return new KeyValuePair>(property.Alias, new object[] { strVal.StripHtml() }); //store the raw value - yield return new KeyValuePair>($"{UmbracoExamineIndexer.RawFieldPrefix}{property.Alias}", new object[] { strVal }); + yield return new KeyValuePair>($"{UmbracoExamineIndex.RawFieldPrefix}{property.Alias}", new object[] { strVal }); } } } diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs index d681d9296e..ac6b425e27 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs @@ -108,7 +108,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // +(+parentID:-1) +__IndexType:media var criteria = searchProvider.CreateCriteria("media"); - var filter = criteria.ParentId(-1).Not().Field(UmbracoExamineIndexer.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); + var filter = criteria.ParentId(-1).Not().Field(UmbracoExamineIndex.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); var result = searchProvider.Search(filter.Compile()); if (result != null) @@ -294,7 +294,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // note that since the use of the wildcard, it automatically escapes it in Lucene. var criteria = searchProvider.CreateCriteria("media"); - var filter = criteria.Id(id.ToInvariantString()).Not().Field(UmbracoExamineIndexer.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); + var filter = criteria.Id(id.ToInvariantString()).Not().Field(UmbracoExamineIndex.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); var result = searchProvider.Search(filter.Compile()).FirstOrDefault(); if (result != null) return ConvertFromSearchResult(result); @@ -476,7 +476,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache { //We are going to check for a special field however, that is because in some cases we store a 'Raw' //value in the index such as for xml/html. - var rawValue = dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(UmbracoExamineIndexer.RawFieldPrefix + alias)); + var rawValue = dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(UmbracoExamineIndex.RawFieldPrefix + alias)); return rawValue ?? dd.Properties.FirstOrDefault(x => x.Alias.InvariantEquals(alias)); } @@ -509,7 +509,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache //first check in Examine as this is WAY faster var criteria = searchProvider.CreateCriteria("media"); - var filter = criteria.ParentId(parentId).Not().Field(UmbracoExamineIndexer.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); + var filter = criteria.ParentId(parentId).Not().Field(UmbracoExamineIndex.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard()); //the above filter will create a query like this, NOTE: That since the use of the wildcard, it automatically escapes it in Lucene. //+(+parentId:3113 -__Path:-1,-21,*) +__IndexType:media diff --git a/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs b/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs index 623bd5b75f..f8b2c6ef8b 100644 --- a/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs +++ b/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs @@ -57,10 +57,10 @@ namespace Umbraco.Web.Search private IIndex CreateInternalIndex() { - var index = new UmbracoContentIndexer( + var index = new UmbracoContentIndex( Constants.UmbracoIndexes.InternalIndexName, //fixme - how to deal with languages like in UmbracoContentIndexer.CreateFieldValueTypes - UmbracoExamineIndexer.UmbracoIndexFieldDefinitions, + UmbracoExamineIndex.UmbracoIndexFieldDefinitions, GetFileSystemLuceneDirectory(Constants.UmbracoIndexes.InternalIndexPath), new CultureInvariantWhitespaceAnalyzer(), ProfilingLogger, @@ -71,10 +71,10 @@ namespace Umbraco.Web.Search private IIndex CreateExternalIndex() { - var index = new UmbracoContentIndexer( + var index = new UmbracoContentIndex( Constants.UmbracoIndexes.ExternalIndexName, //fixme - how to deal with languages like in UmbracoContentIndexer.CreateFieldValueTypes - UmbracoExamineIndexer.UmbracoIndexFieldDefinitions, + UmbracoExamineIndex.UmbracoIndexFieldDefinitions, GetFileSystemLuceneDirectory(Constants.UmbracoIndexes.ExternalIndexPath), new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_30), ProfilingLogger, @@ -85,10 +85,10 @@ namespace Umbraco.Web.Search private IIndex CreateMemberIndex() { - var index = new UmbracoMemberIndexer( + var index = new UmbracoMemberIndex( Constants.UmbracoIndexes.MembersIndexName, //fixme - how to deal with languages like in UmbracoContentIndexer.CreateFieldValueTypes - UmbracoExamineIndexer.UmbracoIndexFieldDefinitions, + UmbracoExamineIndex.UmbracoIndexFieldDefinitions, GetFileSystemLuceneDirectory(Constants.UmbracoIndexes.MembersIndexPath), new CultureInvariantWhitespaceAnalyzer(), ProfilingLogger,