Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException when publishing content during epi initialization #59

Open
MikolajDlus opened this issue Apr 28, 2021 · 0 comments

Comments

@MikolajDlus
Copy link
Contributor

When trying to update (publishing) content during epi initialization (f.e. with Forte Migrations) system throws NullReferenceException while checking for edit access rights. As a workaround we have to disable automatic redirects before saving content and reenable it after.

Stacktrace:

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Web.Security.UrlAuthorizationModule.CheckUrlAccessForPrincipal(String virtualPath, IPrincipal user, String verb)
   at EPiServer.Security.Internal.PathAccessChecker.HasPathAccess(String path, IPrincipal principal)
   at EPiServer.Security.Internal.PathAccessChecker.HasEditAccess(IPrincipal principal)
   at EPiServer.Web.Internal.DefaultDisplayChannelService.<>c.<.ctor>b__3_0(IPrincipal p)
   at EPiServer.Web.Internal.DefaultDisplayChannelService.GetActiveChannels(HttpContextBase context)
   at EPiServer.Web.Internal.TemplateResolverImplementation.ResolveCore(HttpContextBase httpContext, ContentType contentType, Type itemType, Object itemToRender, TemplateTypeCategories category, String tag)
   at EPiServer.Web.TemplateResolver.Resolve(HttpContextBase httpContext, Object itemToRender, TemplateTypeCategories templateTypeCategory, ContextMode contextMode)
   at EPiServer.Web.TemplateResolver.HasTemplate(IContentData contentData, TemplateTypeCategories templateTypeCategory, ContextMode contextMode)
   at EPiServer.Web.Routing.Internal.DefaultUrlResolver.GetVirtualPath(ContentReference contentLink, String language, VirtualPathArguments arguments)
   at Forte.EpiserverRedirects.System.SystemRedirectsEventsModule.GetContentUrl(ContentReference contentReference, String language, Boolean validateTemplate)
   at Forte.EpiserverRedirects.System.SystemRedirectsEventsModule.PublishedContentHandler(Object sender, ContentEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at EPiServer.Core.Internal.DefaultContentEvents.RaiseContentEvent(String key, ContentEventArgs eventArgs)
   at EPiServer.Core.Internal.DefaultContentRepository.RaisePostSaveEvents(SaveContentEventArgs eventArgs, StatusTransition transition, Boolean isNew, Boolean isNewLanguageBranch)
   at EPiServer.Core.Internal.DefaultContentRepository.Save(IContent content, SaveAction action, AccessLevel access)
   at Farmasiet.CMS.Migrations.InitializeLowStockTresholdSetting.ExecuteAsync() in E:\Dev\Repos\Farmasiet\Farmasiet.CMS\Migrations\052_InitializeLowStockTresholdSetting.cs:line 31
   at Forte.Migrations.EPiServer.RunAsMigrationDecorator.Decorator.<ExecuteAsync>d__3.MoveNext()```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant