mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-15 21:17:14 +08:00
Merge pull request #5852 from Codinlab/issue/5737
[Fixes #5737] ChangeListView throws NRE on unpublished Lists
This commit is contained in:
commit
1e87eee2e4
@ -380,7 +380,11 @@ namespace Orchard.Lists.Controllers {
|
||||
[HttpPost, ActionName("List")]
|
||||
[FormValueRequired("listViewName")]
|
||||
public ActionResult ChangeListView(int containerId, string listViewName, PagerParameters pagerParameters) {
|
||||
var container = _containerService.Get(containerId);
|
||||
var container = _containerService.Get(containerId, VersionOptions.Latest);
|
||||
if (container == null || !container.Has<ContainerPart>()) {
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
container.Record.AdminListViewName = listViewName;
|
||||
return RedirectToAction("List", new { containerId, page = pagerParameters.Page, pageSize = pagerParameters.PageSize });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user