Fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -34,7 +34,7 @@ namespace Umbraco.Cms.Core.Services.Implement
|
||||
{
|
||||
if (_macroRepository is not IMacroWithAliasRepository macroWithAliasRepository)
|
||||
{
|
||||
return GetAll().First();
|
||||
return GetAll().FirstOrDefault(x=>x.Alias == alias);
|
||||
}
|
||||
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
@@ -68,7 +68,8 @@ namespace Umbraco.Cms.Core.Services.Implement
|
||||
{
|
||||
if (_macroRepository is not IMacroWithAliasRepository macroWithAliasRepository)
|
||||
{
|
||||
return GetAll();
|
||||
var hashset = new HashSet<string>(aliases);
|
||||
return GetAll().Where(x=> hashset.Contains(x.Alias));
|
||||
}
|
||||
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
|
||||
@@ -88,6 +88,10 @@ namespace Umbraco.Cms.Infrastructure.Templates
|
||||
foreach (var macro in macros)
|
||||
{
|
||||
var macroConfig = macroConfigs.FirstOrDefault(f => f.Alias == macro.Item1);
|
||||
if (macroConfig is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foundMacroUmbracoEntityReferences.Add(new UmbracoEntityReference(Udi.Create(Constants.UdiEntityType.Macro, macroConfig.Key)));
|
||||
// Only do this if the macros actually have parameters
|
||||
if (macroConfig.Properties != null && macroConfig.Properties.Keys.Any(f => f != "macroAlias"))
|
||||
|
||||
Reference in New Issue
Block a user