From 125423947c6a0118f2ded2e19ac269dd36d0358c Mon Sep 17 00:00:00 2001 From: Mario Lopez Date: Fri, 18 Jan 2019 21:58:16 +1100 Subject: [PATCH 1/5] add Udi[] to TypedContent helper --- src/Umbraco.Web/UmbracoHelper.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index bb9bd2d50e..f7eafd8301 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -677,6 +677,19 @@ namespace Umbraco.Web return TypedContentForObjects(ids); } + + + /// + /// Gets the medias corresponding to the identifiers. + /// + /// The unique identifiers, or the keys, of the content items. + /// The content items that were found in the cache + public IEnumerable TypedContent(params Udi[] ids) + { + return TypedContentForObjects(ids); + } + + private IEnumerable TypedContentForObjects(IEnumerable ids) { var idsA = ids.ToArray(); @@ -753,6 +766,17 @@ namespace Umbraco.Web return ContentQuery.TypedContent(ids); } + + /// + /// Gets the medias corresponding to the identifiers. + /// + /// The unique identifiers, or the keys, of the content items. + /// The content items that were found in the cache + public IEnumerable TypedContent(IEnumerable ids) + { + return TypedContentForObjects(ids); + } + public IEnumerable TypedContentAtXPath(string xpath, params XPathVariable[] vars) { return ContentQuery.TypedContentAtXPath(xpath, vars); @@ -938,6 +962,10 @@ namespace Umbraco.Web guidId = g; return true; + case Udi u: + guidId = new GuidUdi(u.UriValue).Guid; + return true; + default: guidId = default; return false; From 9a6d938004ab1447b2be9ff7cba7ac94ef16ead4 Mon Sep 17 00:00:00 2001 From: Mario Lopez Date: Thu, 28 Feb 2019 11:22:32 +1100 Subject: [PATCH 2/5] fixed xmldoc --- src/Umbraco.Web/UmbracoHelper.cs | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index f7eafd8301..f920314075 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -675,12 +675,12 @@ namespace Umbraco.Web public IEnumerable TypedContent(params object[] ids) { return TypedContentForObjects(ids); - } + } /// - /// Gets the medias corresponding to the identifiers. + /// Gets the content corresponding to the identifiers. /// /// The unique identifiers, or the keys, of the content items. /// The content items that were found in the cache @@ -768,7 +768,7 @@ namespace Umbraco.Web /// - /// Gets the medias corresponding to the identifiers. + /// Gets the content corresponding to the identifiers. /// /// The unique identifiers, or the keys, of the content items. /// The content items that were found in the cache @@ -1306,28 +1306,28 @@ namespace Umbraco.Web public IEnumerable TypedSearch(string term, bool useWildCards = true, string searchProvider = null) { return ContentQuery.TypedSearch(term, useWildCards, searchProvider); - } - + } + /// /// Searches content - /// - /// - /// + /// + /// + /// /// /// /// /// /// - public IEnumerable TypedSearch(int skip, int take, out int totalRecords, string term, bool useWildCards = true, string searchProvider = null) + public IEnumerable TypedSearch(int skip, int take, out int totalRecords, string term, bool useWildCards = true, string searchProvider = null) { - return ContentQuery.TypedSearch(skip, take, out totalRecords, term, useWildCards, searchProvider); - } - + return ContentQuery.TypedSearch(skip, take, out totalRecords, term, useWildCards, searchProvider); + } + /// /// Searhes content - /// - /// - /// + /// + /// + /// /// /// /// @@ -1335,23 +1335,23 @@ namespace Umbraco.Web public IEnumerable TypedSearch(int skip, int take, out int totalRecords, Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) { return ContentQuery.TypedSearch(skip, take, out totalRecords, criteria, searchProvider); - } - + } + /// /// Searhes content /// /// /// /// - public IEnumerable TypedSearch(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) + public IEnumerable TypedSearch(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) { - return ContentQuery.TypedSearch(criteria, searchProvider); - } - + return ContentQuery.TypedSearch(criteria, searchProvider); + } + #endregion - + #region Xml - + public dynamic ToDynamicXml(string xml) { if (string.IsNullOrWhiteSpace(xml)) return null; From 2c271d3ef4864fdd294cc1b3e9cff7e1db503f7b Mon Sep 17 00:00:00 2001 From: Marcin Bigoraj Date: Fri, 18 Jan 2019 14:36:44 +0100 Subject: [PATCH 3/5] Allow RTE to set form dirty again after saving content item --- .../src/views/propertyeditors/rte/rte.controller.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index 2b81521ca9..dd76d2e635 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -380,6 +380,9 @@ angular.module("umbraco") if (tinyMceEditor !== undefined && tinyMceEditor != null && !$scope.isLoading) { $scope.model.value = tinyMceEditor.getContent(); } + + //Allow RTE to set form dirty again + alreadyDirty = false; }); //when the element is disposed we need to unsubscribe! From 5d3b62317325788fadb4c84629ba4cc46704da0a Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Fri, 8 Feb 2019 17:15:13 -0700 Subject: [PATCH 4/5] Fix for RTE never being dirty after initial save (#4140) --- .../src/views/propertyeditors/rte/rte.controller.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index dd76d2e635..17dddbe669 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -11,20 +11,15 @@ angular.module("umbraco") var n = d.getTime(); $scope.textAreaHtmlId = $scope.model.alias + "_" + n + "_rte"; - var alreadyDirty = false; function syncContent(editor){ editor.save(); angularHelper.safeApply($scope, function () { $scope.model.value = editor.getContent(); }); - if (!alreadyDirty) { - //make the form dirty manually so that the track changes works, setting our model doesn't trigger - // the angular bits because tinymce replaces the textarea. - var currForm = angularHelper.getCurrentForm($scope); - currForm.$setDirty(); - alreadyDirty = true; - } + //make the form dirty manually so that the track changes works, setting our model doesn't trigger + // the angular bits because tinymce replaces the textarea. + angularHelper.getCurrentForm($scope).$setDirty(); } tinyMceService.configuration().then(function (tinyMceConfig) { From 1a4a3504d0796b620350e303e490e76f40828b57 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 20 Mar 2019 23:27:42 +0100 Subject: [PATCH 5/5] Remove unused variable --- .../src/views/propertyeditors/rte/rte.controller.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index 17dddbe669..1fc648083e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -375,9 +375,6 @@ angular.module("umbraco") if (tinyMceEditor !== undefined && tinyMceEditor != null && !$scope.isLoading) { $scope.model.value = tinyMceEditor.getContent(); } - - //Allow RTE to set form dirty again - alreadyDirty = false; }); //when the element is disposed we need to unsubscribe! @@ -386,8 +383,8 @@ angular.module("umbraco") $scope.$on('$destroy', function () { unsubscribe(); if (tinyMceEditor !== undefined && tinyMceEditor != null) { - tinyMceEditor.destroy() - } + tinyMceEditor.destroy(); + } }); }); });