From 2cd92353ec2a39d05dd5989a4784fdc25ec50bbf Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 22 Jan 2015 12:17:36 +1100 Subject: [PATCH] Removes listening on legacy events for the CacheRefresherEventHandler --- src/Umbraco.Core/Cache/CacheKeys.cs | 1 + src/Umbraco.Core/Services/DomainService.cs | 43 +++- .../Cache/CacheRefresherEventHandler.cs | 207 ++++-------------- .../Cache/DistributedCacheExtensions.cs | 4 +- src/Umbraco.Web/Cache/DomainCacheRefresher.cs | 2 - .../businesslogic/Packager/Installer.cs | 1 + .../datatype/DataTypeDefinition.cs | 2 +- src/umbraco.cms/businesslogic/macro/Macro.cs | 2 + 8 files changed, 83 insertions(+), 179 deletions(-) diff --git a/src/Umbraco.Core/Cache/CacheKeys.cs b/src/Umbraco.Core/Cache/CacheKeys.cs index c370b13303..f76ff0439f 100644 --- a/src/Umbraco.Core/Cache/CacheKeys.cs +++ b/src/Umbraco.Core/Cache/CacheKeys.cs @@ -48,6 +48,7 @@ namespace Umbraco.Core.Cache [Obsolete("This is no longer used and will be removed from the codebase in the future")] public const string LanguageCacheKey = "UmbracoLanguageCache"; + [Obsolete("This is no longer used and will be removed from the codebase in the future")] public const string DomainCacheKey = "UmbracoDomainList"; [Obsolete("This is no longer used and will be removed from the codebase in the future")] diff --git a/src/Umbraco.Core/Services/DomainService.cs b/src/Umbraco.Core/Services/DomainService.cs index 86d883bd48..f2ff88e001 100644 --- a/src/Umbraco.Core/Services/DomainService.cs +++ b/src/Umbraco.Core/Services/DomainService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Umbraco.Core.Events; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Persistence; @@ -9,8 +10,6 @@ using Umbraco.Core.Persistence.UnitOfWork; namespace Umbraco.Core.Services { - //TODO: Add events! - public class DomainService : RepositoryService, IDomainService { public DomainService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger) @@ -29,12 +28,18 @@ namespace Umbraco.Core.Services public void Delete(IDomain domain) { + if (Deleting.IsRaisedEventCancelled(new DeleteEventArgs(domain), this)) + return; + var uow = UowProvider.GetUnitOfWork(); using (var repository = RepositoryFactory.CreateDomainRepository(uow)) { repository.Delete(domain); - uow.Commit(); + uow.Commit(); } + + var args = new DeleteEventArgs(domain, false); + Deleted.RaiseEvent(args, this); } public IDomain GetByName(string name) @@ -77,8 +82,8 @@ namespace Umbraco.Core.Services { if (raiseEvents) { - //if (Saving.IsRaisedEventCancelled(new SaveEventArgs(content), this)) - // return; + if (Saving.IsRaisedEventCancelled(new SaveEventArgs(domainEntity), this)) + return; } var uow = UowProvider.GetUnitOfWork(); @@ -88,8 +93,32 @@ namespace Umbraco.Core.Services uow.Commit(); } - //if (raiseEvents) - // Saved.RaiseEvent(new SaveEventArgs(content, false), this); + if (raiseEvents) + Saved.RaiseEvent(new SaveEventArgs(domainEntity, false), this); } + + #region Event Handlers + /// + /// Occurs before Delete + /// + public static event TypedEventHandler> Deleting; + + /// + /// Occurs after Delete + /// + public static event TypedEventHandler> Deleted; + + /// + /// Occurs before Save + /// + public static event TypedEventHandler> Saving; + + /// + /// Occurs after Save + /// + public static event TypedEventHandler> Saved; + + + #endregion } } \ No newline at end of file diff --git a/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs b/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs index 56c0669819..8cc56a7e95 100644 --- a/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs +++ b/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs @@ -1,25 +1,17 @@ using System; -using System.Collections.Generic; using Umbraco.Core; -using Umbraco.Core.Cache; using Umbraco.Core.Events; using Umbraco.Core.Models; -using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Models.Membership; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Services; -using umbraco; using umbraco.BusinessLogic; using umbraco.cms.businesslogic; -using umbraco.cms.businesslogic.member; using System.Linq; using umbraco.cms.businesslogic.web; using Content = Umbraco.Core.Models.Content; using ApplicationTree = Umbraco.Core.Models.ApplicationTree; using DeleteEventArgs = umbraco.cms.businesslogic.DeleteEventArgs; -using Macro = umbraco.cms.businesslogic.macro.Macro; -using Member = umbraco.cms.businesslogic.member.Member; -using Template = umbraco.cms.businesslogic.template.Template; namespace Umbraco.Web.Cache { @@ -46,44 +38,30 @@ namespace Umbraco.Web.Cache UserService.DeletedUser += UserServiceDeletedUser; //Bind to dictionary events - //NOTE: we need to bind to legacy and new API events currently: http://issues.umbraco.org/issue/U4-1979 - global::umbraco.cms.businesslogic.Dictionary.DictionaryItem.New += DictionaryItemNew; - global::umbraco.cms.businesslogic.Dictionary.DictionaryItem.Saving +=DictionaryItemSaving; - global::umbraco.cms.businesslogic.Dictionary.DictionaryItem.Deleted +=DictionaryItemDeleted; LocalizationService.DeletedDictionaryItem += LocalizationServiceDeletedDictionaryItem; LocalizationService.SavedDictionaryItem += LocalizationServiceSavedDictionaryItem; //Bind to data type events //NOTE: we need to bind to legacy and new API events currently: http://issues.umbraco.org/issue/U4-1979 - + //TODO: Wrap as much of this api as possible so that we don't need to listen to legacy events! global::umbraco.cms.businesslogic.datatype.DataTypeDefinition.AfterDelete += DataTypeDefinitionDeleting; global::umbraco.cms.businesslogic.datatype.DataTypeDefinition.Saving += DataTypeDefinitionSaving; DataTypeService.Deleted += DataTypeServiceDeleted; DataTypeService.Saved += DataTypeServiceSaved; //Bind to stylesheet events - //NOTE: we need to bind to legacy and new API events currently: http://issues.umbraco.org/issue/U4-1979 - global::umbraco.cms.businesslogic.web.StylesheetProperty.AfterSave += StylesheetPropertyAfterSave; - global::umbraco.cms.businesslogic.web.StylesheetProperty.AfterDelete += StylesheetPropertyAfterDelete; - global::umbraco.cms.businesslogic.web.StyleSheet.AfterDelete += StyleSheetAfterDelete; - global::umbraco.cms.businesslogic.web.StyleSheet.AfterSave += StyleSheetAfterSave; FileService.SavedStylesheet += FileServiceSavedStylesheet; FileService.DeletedStylesheet += FileServiceDeletedStylesheet; //Bind to domain events - Domain.AfterSave += DomainAfterSave; - Domain.AfterDelete += DomainAfterDelete; - Domain.New += DomainNew; + DomainService.Saved += DomainService_Saved; + DomainService.Deleted += DomainService_Deleted; //Bind to language events - //NOTE: we need to bind to legacy and new API events currently: http://issues.umbraco.org/issue/U4-1979 - global::umbraco.cms.businesslogic.language.Language.AfterDelete += LanguageAfterDelete; - global::umbraco.cms.businesslogic.language.Language.New += LanguageNew; - global::umbraco.cms.businesslogic.language.Language.AfterSave += LanguageAfterSave; LocalizationService.SavedLanguage += LocalizationServiceSavedLanguage; LocalizationService.DeletedLanguage += LocalizationServiceDeletedLanguage; @@ -98,23 +76,19 @@ namespace Umbraco.Web.Cache //Bind to permission events + //TODO: Wrap legacy permissions so we can get rid of this Permission.New += PermissionNew; Permission.Updated += PermissionUpdated; Permission.Deleted += PermissionDeleted; PermissionRepository.AssignedPermissions += CacheRefresherEventHandler_AssignedPermissions; //Bind to template events - //NOTE: we need to bind to legacy and new API events currently: http://issues.umbraco.org/issue/U4-1979 - Template.AfterSave += TemplateAfterSave; - Template.AfterDelete += TemplateAfterDelete; FileService.SavedTemplate += FileServiceSavedTemplate; FileService.DeletedTemplate += FileServiceDeletedTemplate; //Bind to macro events - Macro.AfterSave += MacroAfterSave; - Macro.AfterDelete += MacroAfterDelete; MacroService.Saved += MacroServiceSaved; MacroService.Deleted += MacroServiceDeleted; @@ -147,6 +121,8 @@ namespace Umbraco.Web.Cache Access.AfterSave += Access_AfterSave; } + + #region Public access event handlers static void Access_AfterSave(Access sender, SaveEventArgs e) @@ -258,41 +234,41 @@ namespace Umbraco.Web.Cache #endregion #region ApplicationTree event handlers - static void ApplicationTreeNew(ApplicationTree sender, System.EventArgs e) + static void ApplicationTreeNew(ApplicationTree sender, EventArgs e) { DistributedCache.Instance.RefreshAllApplicationTreeCache(); } - static void ApplicationTreeUpdated(ApplicationTree sender, System.EventArgs e) + static void ApplicationTreeUpdated(ApplicationTree sender, EventArgs e) { DistributedCache.Instance.RefreshAllApplicationTreeCache(); } - static void ApplicationTreeDeleted(ApplicationTree sender, System.EventArgs e) + static void ApplicationTreeDeleted(ApplicationTree sender, EventArgs e) { DistributedCache.Instance.RefreshAllApplicationTreeCache(); } #endregion #region Application event handlers - static void ApplicationNew(Section sender, System.EventArgs e) + static void ApplicationNew(Section sender, EventArgs e) { DistributedCache.Instance.RefreshAllApplicationCache(); } - static void ApplicationDeleted(Section sender, System.EventArgs e) + static void ApplicationDeleted(Section sender, EventArgs e) { DistributedCache.Instance.RefreshAllApplicationCache(); } #endregion #region UserType event handlers - static void UserServiceDeletedUserType(IUserService sender, Core.Events.DeleteEventArgs e) + static void UserServiceDeletedUserType(IUserService sender, DeleteEventArgs e) { e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveUserTypeCache(x.Id)); } - static void UserServiceSavedUserType(IUserService sender, Core.Events.SaveEventArgs e) + static void UserServiceSavedUserType(IUserService sender, SaveEventArgs e) { e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshUserTypeCache(x.Id)); } @@ -301,40 +277,25 @@ namespace Umbraco.Web.Cache #region Dictionary event handlers - static void LocalizationServiceSavedDictionaryItem(ILocalizationService sender, Core.Events.SaveEventArgs e) + static void LocalizationServiceSavedDictionaryItem(ILocalizationService sender, SaveEventArgs e) { e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshDictionaryCache(x.Id)); } - static void LocalizationServiceDeletedDictionaryItem(ILocalizationService sender, Core.Events.DeleteEventArgs e) + static void LocalizationServiceDeletedDictionaryItem(ILocalizationService sender, DeleteEventArgs e) { e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveDictionaryCache(x.Id)); } - static void DictionaryItemDeleted(global::umbraco.cms.businesslogic.Dictionary.DictionaryItem sender, System.EventArgs e) - { - DistributedCache.Instance.RemoveDictionaryCache(sender.id); - } - - static void DictionaryItemSaving(global::umbraco.cms.businesslogic.Dictionary.DictionaryItem sender, System.EventArgs e) - { - DistributedCache.Instance.RefreshDictionaryCache(sender.id); - } - - static void DictionaryItemNew(global::umbraco.cms.businesslogic.Dictionary.DictionaryItem sender, System.EventArgs e) - { - DistributedCache.Instance.RefreshDictionaryCache(sender.id); - } - #endregion #region DataType event handlers - static void DataTypeServiceSaved(IDataTypeService sender, Core.Events.SaveEventArgs e) + static void DataTypeServiceSaved(IDataTypeService sender, SaveEventArgs e) { e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshDataTypeCache(x)); } - static void DataTypeServiceDeleted(IDataTypeService sender, Core.Events.DeleteEventArgs e) + static void DataTypeServiceDeleted(IDataTypeService sender, DeleteEventArgs e) { e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveDataTypeCache(x)); } @@ -351,52 +312,31 @@ namespace Umbraco.Web.Cache #endregion #region Stylesheet and stylesheet property event handlers - static void StylesheetPropertyAfterSave(global::umbraco.cms.businesslogic.web.StylesheetProperty sender, SaveEventArgs e) - { - DistributedCache.Instance.RefreshStylesheetPropertyCache(sender); - } - - static void StylesheetPropertyAfterDelete(global::umbraco.cms.businesslogic.web.StylesheetProperty sender, DeleteEventArgs e) - { - DistributedCache.Instance.RemoveStylesheetPropertyCache(sender); - } - - static void FileServiceDeletedStylesheet(IFileService sender, Core.Events.DeleteEventArgs e) + + static void FileServiceDeletedStylesheet(IFileService sender, DeleteEventArgs e) { e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveStylesheetCache(x)); } - static void FileServiceSavedStylesheet(IFileService sender, Core.Events.SaveEventArgs e) + static void FileServiceSavedStylesheet(IFileService sender, SaveEventArgs e) { e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshStylesheetCache(x)); } - static void StyleSheetAfterSave(StyleSheet sender, SaveEventArgs e) - { - DistributedCache.Instance.RefreshStylesheetCache(sender); - } - - static void StyleSheetAfterDelete(StyleSheet sender, DeleteEventArgs e) - { - DistributedCache.Instance.RemoveStylesheetCache(sender); - } #endregion #region Domain event handlers - static void DomainNew(Domain sender, NewEventArgs e) + + static void DomainService_Saved(IDomainService sender, SaveEventArgs e) { - DistributedCache.Instance.RefreshDomainCache(sender); + e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshDomainCache(x)); } - static void DomainAfterDelete(Domain sender, DeleteEventArgs e) + static void DomainService_Deleted(IDomainService sender, DeleteEventArgs e) { - DistributedCache.Instance.RemoveDomainCache(sender); + e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveDomainCache(x)); } - static void DomainAfterSave(Domain sender, SaveEventArgs e) - { - DistributedCache.Instance.RefreshDomainCache(sender); - } #endregion #region Language event handlers @@ -405,7 +345,7 @@ namespace Umbraco.Web.Cache /// /// /// - static void LocalizationServiceDeletedLanguage(ILocalizationService sender, Core.Events.DeleteEventArgs e) + static void LocalizationServiceDeletedLanguage(ILocalizationService sender, DeleteEventArgs e) { e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveLanguageCache(x)); } @@ -415,40 +355,11 @@ namespace Umbraco.Web.Cache /// /// /// - static void LocalizationServiceSavedLanguage(ILocalizationService sender, Core.Events.SaveEventArgs e) + static void LocalizationServiceSavedLanguage(ILocalizationService sender, SaveEventArgs e) { e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshLanguageCache(x)); } - - /// - /// Fires when a langauge is saved - /// - /// - /// - static void LanguageAfterSave(global::umbraco.cms.businesslogic.language.Language sender, SaveEventArgs e) - { - DistributedCache.Instance.RefreshLanguageCache(sender); - } - - /// - /// Fires when a langauge is created - /// - /// - /// - static void LanguageNew(global::umbraco.cms.businesslogic.language.Language sender, NewEventArgs e) - { - DistributedCache.Instance.RefreshLanguageCache(sender); - } - - /// - /// Fires when a langauge is deleted - /// - /// - /// - static void LanguageAfterDelete(global::umbraco.cms.businesslogic.language.Language sender, DeleteEventArgs e) - { - DistributedCache.Instance.RemoveLanguageCache(sender); - } + #endregion #region Content/media/member Type event handlers @@ -457,7 +368,7 @@ namespace Umbraco.Web.Cache /// /// /// - static void ContentTypeServiceDeletedMediaType(IContentTypeService sender, Core.Events.DeleteEventArgs e) + static void ContentTypeServiceDeletedMediaType(IContentTypeService sender, DeleteEventArgs e) { e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveMediaTypeCache(x)); } @@ -467,7 +378,7 @@ namespace Umbraco.Web.Cache /// /// /// - static void ContentTypeServiceDeletedContentType(IContentTypeService sender, Core.Events.DeleteEventArgs e) + static void ContentTypeServiceDeletedContentType(IContentTypeService sender, DeleteEventArgs e) { e.DeletedEntities.ForEach(contentType => DistributedCache.Instance.RemoveContentTypeCache(contentType)); } @@ -477,7 +388,7 @@ namespace Umbraco.Web.Cache /// /// /// - static void MemberTypeServiceDeleted(IMemberTypeService sender, Core.Events.DeleteEventArgs e) + static void MemberTypeServiceDeleted(IMemberTypeService sender, DeleteEventArgs e) { e.DeletedEntities.ForEach(contentType => DistributedCache.Instance.RemoveMemberTypeCache(contentType)); } @@ -487,7 +398,7 @@ namespace Umbraco.Web.Cache /// /// /// - static void ContentTypeServiceSavedMediaType(IContentTypeService sender, Core.Events.SaveEventArgs e) + static void ContentTypeServiceSavedMediaType(IContentTypeService sender, SaveEventArgs e) { e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshMediaTypeCache(x)); } @@ -497,7 +408,7 @@ namespace Umbraco.Web.Cache /// /// /// - static void ContentTypeServiceSavedContentType(IContentTypeService sender, Core.Events.SaveEventArgs e) + static void ContentTypeServiceSavedContentType(IContentTypeService sender, SaveEventArgs e) { e.SavedEntities.ForEach(contentType => DistributedCache.Instance.RefreshContentTypeCache(contentType)); } @@ -507,7 +418,7 @@ namespace Umbraco.Web.Cache /// /// /// - static void MemberTypeServiceSaved(IMemberTypeService sender, Core.Events.SaveEventArgs e) + static void MemberTypeServiceSaved(IMemberTypeService sender, SaveEventArgs e) { e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshMemberTypeCache(x)); } @@ -573,7 +484,7 @@ namespace Umbraco.Web.Cache /// /// /// - static void FileServiceDeletedTemplate(IFileService sender, Core.Events.DeleteEventArgs e) + static void FileServiceDeletedTemplate(IFileService sender, DeleteEventArgs e) { e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveTemplateCache(x.Id)); } @@ -583,35 +494,16 @@ namespace Umbraco.Web.Cache /// /// /// - static void FileServiceSavedTemplate(IFileService sender, Core.Events.SaveEventArgs e) + static void FileServiceSavedTemplate(IFileService sender, SaveEventArgs e) { e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshTemplateCache(x.Id)); } - - /// - /// Removes cache for template - /// - /// - /// - static void TemplateAfterDelete(Template sender, DeleteEventArgs e) - { - DistributedCache.Instance.RemoveTemplateCache(sender.Id); - } - - /// - /// Refresh cache for template - /// - /// - /// - static void TemplateAfterSave(Template sender, SaveEventArgs e) - { - DistributedCache.Instance.RefreshTemplateCache(sender.Id); - } + #endregion #region Macro event handlers - void MacroServiceDeleted(IMacroService sender, Core.Events.DeleteEventArgs e) + void MacroServiceDeleted(IMacroService sender, DeleteEventArgs e) { foreach (var entity in e.DeletedEntities) { @@ -619,33 +511,14 @@ namespace Umbraco.Web.Cache } } - void MacroServiceSaved(IMacroService sender, Core.Events.SaveEventArgs e) + void MacroServiceSaved(IMacroService sender, SaveEventArgs e) { foreach (var entity in e.SavedEntities) { DistributedCache.Instance.RefreshMacroCache(entity); } } - - /// - /// Flush macro from cache - /// - /// - /// - static void MacroAfterDelete(Macro sender, DeleteEventArgs e) - { - DistributedCache.Instance.RemoveMacroCache(sender); - } - - /// - /// Flush macro from cache - /// - /// - /// - static void MacroAfterSave(Macro sender, SaveEventArgs e) - { - DistributedCache.Instance.RefreshMacroCache(sender); - } + #endregion #region Media event handlers diff --git a/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs b/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs index 0185e76f30..9477d4a075 100644 --- a/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs +++ b/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs @@ -648,7 +648,7 @@ namespace Umbraco.Web.Cache #region Domain Cache - public static void RefreshDomainCache(this DistributedCache dc, Domain domain) + public static void RefreshDomainCache(this DistributedCache dc, IDomain domain) { if (domain != null) { @@ -656,7 +656,7 @@ namespace Umbraco.Web.Cache } } - public static void RemoveDomainCache(this DistributedCache dc, Domain domain) + public static void RemoveDomainCache(this DistributedCache dc, IDomain domain) { if (domain != null) { diff --git a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs index f5f0fb442b..11f8291e6c 100644 --- a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs @@ -40,8 +40,6 @@ namespace Umbraco.Web.Cache private void ClearCache() { - ApplicationContext.Current.ApplicationCache.ClearCacheItem(CacheKeys.DomainCacheKey); - // SD: we need to clear the routes cache here! // // zpqrtbnk: no, not here, in fact the caches should subsribe to refresh events else we diff --git a/src/umbraco.cms/businesslogic/Packager/Installer.cs b/src/umbraco.cms/businesslogic/Packager/Installer.cs index 552a9e62e4..4be82ba7b7 100644 --- a/src/umbraco.cms/businesslogic/Packager/Installer.cs +++ b/src/umbraco.cms/businesslogic/Packager/Installer.cs @@ -352,6 +352,7 @@ namespace umbraco.cms.businesslogic.packager #region Macros foreach (XmlNode n in Config.DocumentElement.SelectNodes("//macro")) { + //TODO: Fix this, this should not use the legacy API Macro m = Macro.Import(n); if (m != null) diff --git a/src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs b/src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs index 821a50342a..da7005ff72 100644 --- a/src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs +++ b/src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs @@ -17,7 +17,7 @@ using Umbraco.Core; namespace umbraco.cms.businesslogic.datatype { - + //TODO: Wrap as much of this api as possible so that we don't need to listen to legacy events! /// /// Datatypedefinitions is the basic buildingblocks of umbraco's documents/medias/members generic datastructure diff --git a/src/umbraco.cms/businesslogic/macro/Macro.cs b/src/umbraco.cms/businesslogic/macro/Macro.cs index 58aa32d7e0..8c1239a056 100644 --- a/src/umbraco.cms/businesslogic/macro/Macro.cs +++ b/src/umbraco.cms/businesslogic/macro/Macro.cs @@ -250,6 +250,8 @@ namespace umbraco.cms.businesslogic.macro } } + //TODO: Fix this, this should wrap a new API! + public static Macro Import(XmlNode n) { var alias = XmlHelper.GetNodeValue(n.SelectSingleNode("alias"));