mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
ElementDriver.OnDisplaying ElementDisplayingContext.Content is not being populated properly when the content item is saved, but not yet published. Instead of query the content only for the published version, use the latest version instead.
This commit is contained in:
parent
a3602ce7b0
commit
1a7d6c6f62
@ -151,7 +151,7 @@ namespace Orchard.Layouts.Controllers {
|
||||
if (contentId == null && contentType == null)
|
||||
return DescribeElementsContext.Empty;
|
||||
|
||||
var part = contentId != null && contentId != 0 ? _contentManager.Get<ILayoutAspect>(contentId.Value)
|
||||
var part = contentId != null && contentId != 0 ? _contentManager.Get<ILayoutAspect>(contentId.Value, VersionOptions.Latest)
|
||||
?? _contentManager.New<ILayoutAspect>(contentType)
|
||||
: _contentManager.New<ILayoutAspect>(contentType);
|
||||
|
||||
@ -172,4 +172,4 @@ namespace Orchard.Layouts.Controllers {
|
||||
ModelState.AddModelError(key, errorMessage.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user