--HG--
branch : dev
This commit is contained in:
Suha Can
2011-03-21 16:34:49 -07:00
parent 14011b7e39
commit 093b6e4f21

View File

@@ -30,7 +30,7 @@ namespace Orchard.Core.Containers.Drivers {
var commonPart = part.As<ICommonPart>(); var commonPart = part.As<ICommonPart>();
var model = new ContainableViewModel(); var model = new ContainableViewModel();
if (commonPart.Container != null) { if (commonPart != null && commonPart.Container != null) {
model.ContainerId = commonPart.Container.Id; model.ContainerId = commonPart.Container.Id;
} }
@@ -38,8 +38,10 @@ namespace Orchard.Core.Containers.Drivers {
var oldContainerId = model.ContainerId; var oldContainerId = model.ContainerId;
updater.TryUpdateModel(model, "Containable", null, null); updater.TryUpdateModel(model, "Containable", null, null);
if (oldContainerId != model.ContainerId) if (oldContainerId != model.ContainerId)
if (commonPart != null) {
commonPart.Container = _contentManager.Get(model.ContainerId, VersionOptions.Latest); commonPart.Container = _contentManager.Get(model.ContainerId, VersionOptions.Latest);
} }
}
// note: string.isnullorempty not being recognized by linq-to-nhibernate hence the inline or // note: string.isnullorempty not being recognized by linq-to-nhibernate hence the inline or
var containers = _contentManager.Query<ContainerPart, ContainerPartRecord>(VersionOptions.Latest) var containers = _contentManager.Query<ContainerPart, ContainerPartRecord>(VersionOptions.Latest)