Fixing General Settings update

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2011-03-16 13:56:15 -07:00
parent ad16d00a8d
commit c4a2de09b6

View File

@@ -64,22 +64,27 @@ namespace Orchard.Core.Settings.Controllers {
var site = _siteService.GetSiteSettings();
dynamic model = Services.ContentManager.UpdateEditor(site, this, groupInfoId);
if (model == null) {
Services.TransactionManager.Cancel();
return HttpNotFound();
}
if (!string.IsNullOrWhiteSpace(groupInfoId)) {
if (model == null) {
Services.TransactionManager.Cancel();
return HttpNotFound();
}
var groupInfo = Services.ContentManager.GetEditorGroupInfo(site, groupInfoId);
if (groupInfo == null) {
Services.TransactionManager.Cancel();
return HttpNotFound();
}
var groupInfo = Services.ContentManager.GetEditorGroupInfo(site, groupInfoId);
if (groupInfo == null) {
Services.TransactionManager.Cancel();
return HttpNotFound();
}
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
model.GroupInfo = groupInfo;
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
if (!ModelState.IsValid) {
Services.TransactionManager.Cancel();
model.GroupInfo = groupInfo;
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object) model);
}
}
else {
return View((object)model);
}