mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-21 03:14:10 +08:00
Merge pull request #6617 from jtkech/patch-6
Fixes Layout OnIndexing when using a snippet element
This commit is contained in:
@@ -11,7 +11,6 @@ using Orchard.DisplayManagement.Shapes;
|
|||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.Logging;
|
using Orchard.Logging;
|
||||||
using Orchard.Mvc;
|
using Orchard.Mvc;
|
||||||
using Orchard.Mvc.Extensions;
|
|
||||||
|
|
||||||
namespace Orchard.DisplayManagement.Implementation {
|
namespace Orchard.DisplayManagement.Implementation {
|
||||||
public class DefaultDisplayManager : IDisplayManager {
|
public class DefaultDisplayManager : IDisplayManager {
|
||||||
@@ -62,7 +61,9 @@ namespace Orchard.DisplayManagement.Implementation {
|
|||||||
return CoerceHtmlString(context.Value);
|
return CoerceHtmlString(context.Value);
|
||||||
|
|
||||||
var workContext = _workContextAccessor.GetContext();
|
var workContext = _workContextAccessor.GetContext();
|
||||||
var shapeTable = !_httpContextAccessor.Current().IsBackgroundContext()
|
// CurrentTheme is now available in the background, so here we no longer use IsBackgroundContext().
|
||||||
|
// We only do a null check, so we can render in the background a view that only exists in the theme.
|
||||||
|
var shapeTable = _httpContextAccessor.Current() != null
|
||||||
? _shapeTableLocator.Value.Lookup(workContext.CurrentTheme.Id)
|
? _shapeTableLocator.Value.Lookup(workContext.CurrentTheme.Id)
|
||||||
: _shapeTableLocator.Value.Lookup(null);
|
: _shapeTableLocator.Value.Lookup(null);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user