fixed: installer cant install macros

This commit is contained in:
perploug
2013-11-01 12:29:00 +01:00
parent 5363cafd7f
commit b7ff856073
2 changed files with 11 additions and 4 deletions

View File

@@ -624,9 +624,13 @@ namespace umbraco.cms.businesslogic.packager
{
try
{
var m = new Macro(alias);
this.ContainsMacroConflict = true;
this._conflictingMacroAliases.Add(m.Name, alias);
var m = Macro.GetByAlias(alias);
if (m != null)
{
this.ContainsMacroConflict = true;
this._conflictingMacroAliases.Add(m.Name, alias);
}
}
catch (IndexOutOfRangeException) { } //thrown when the alias doesn't exist in the DB, ie - macro not there
}

View File

@@ -254,7 +254,10 @@ namespace umbraco.cms.businesslogic.macro
var alias = XmlHelper.GetNodeValue(n.SelectSingleNode("alias"));
//check to see if the macro alreay exists in the system
//it's better if it does and we keep using it, alias *should* be unique remember
var m = Macro.GetByAlias(alias);
if (m == null)
{
m = MakeNew(XmlHelper.GetNodeValue(n.SelectSingleNode("name")));
@@ -432,7 +435,7 @@ namespace umbraco.cms.businesslogic.macro
TimeSpan.FromMinutes(30),
() =>
{
var macro = ApplicationContext.Current.Services.MacroService.GetByAlias(alias);
var macro = ApplicationContext.Current.Services.MacroService.GetByAlias(alias);
if (macro == null) return null;
return new Macro(macro);
});