Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit 6c1ea4e

Browse files
committed
fix: look also for viewcomponent with alias.tofirstupper
1 parent 39855ef commit 6c1ea4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Our.Umbraco.DocTypeGridEditor/Helpers/DocTypeGridEditorHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ public IHtmlContent RenderDocTypeGridEditorItem(
240240
return new HtmlString("");
241241
}
242242

243-
// get view path
244243
if (!TryGetViewPath(htmlHelper.ViewContext, editorAlias, content.ContentType.Alias, viewPath, previewViewPath, isPreview, out string fullViewPath))
245244
{
246245
_logger.LogError("Failed rendering DocTypeGridEditorItem. " +
@@ -299,6 +298,8 @@ private string GetComponentName(string[] names)
299298
{
300299
var componentName = _options.DefaultDocTypeGridEditorViewComponent.Name;
301300
if (componentName.EndsWith("ViewComponent")) componentName = componentName.Substring(0, componentName.LastIndexOf("ViewComponent"));
301+
names = names.SelectMany(x => new[] { x.ToFirstUpper(), x }).Distinct().ToArray();
302+
302303
foreach (var name in names)
303304
{
304305
if (_viewComponentSelector.SelectComponent($"{name}DocTypeGridEditor") != null)

0 commit comments

Comments
 (0)