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

Commit 0e61204

Browse files
Fixed "Current has not been initialized" error
1 parent 32460cf commit 0e61204

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/Our.Umbraco.DocTypeGridEditor/Bootstrap.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Web.Mvc;
22
using Our.Umbraco.DocTypeGridEditor.Web.Attributes;
3+
using Our.Umbraco.DocTypeGridEditor.Web.Mvc;
34
using Umbraco.Core;
45
using Umbraco.Core.Services;
56

@@ -10,6 +11,8 @@ internal class Bootstrap : ApplicationEventHandler
1011
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
1112
{
1213
GlobalFilters.Filters.Add(new DocTypeGridEditorPreviewAttribute());
14+
15+
DefaultDocTypeGridEditorSurfaceControllerResolver.Current = new DefaultDocTypeGridEditorSurfaceControllerResolver()
1316
}
1417

1518
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)

src/Our.Umbraco.DocTypeGridEditor/Web/Mvc/DefaultDocTypeGridEditorSurfaceControllerResolver.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ public class DefaultDocTypeGridEditorSurfaceControllerResolver : SingleObjectRes
1414
/// <summary>
1515
/// Constructor accepting the default SurfaceController
1616
/// </summary>
17-
/// <param name="value"></param>
18-
public DefaultDocTypeGridEditorSurfaceControllerResolver(Type value)
19-
: base(value, true)
20-
{
21-
ValidateType(value);
22-
Value = null;
23-
}
17+
public DefaultDocTypeGridEditorSurfaceControllerResolver()
18+
: base(null, true)
19+
{ }
2420

2521
/// <summary>
2622
/// Sets the default SurfaceController type

0 commit comments

Comments
 (0)