Merge pull request #833 from umbraco/temp-U4-7201

Fixes: U4-7201 Can only save once in some editors after upgrade to 7.3
This commit is contained in:
Shannon Deminick
2015-10-23 11:45:24 +02:00
2 changed files with 17 additions and 10 deletions

View File

@@ -189,8 +189,12 @@
top.UmbSpeechBubble.ShowMessage('save', header, msg);
this._opts.originalFileName = args.name;
this._opts.treeSyncPath = args.path;
if (args && args.name) {
this._opts.originalFileName = args.name;
}
if (args && args.path) {
this._opts.treeSyncPath = args.path;
}
UmbClientMgr.mainTree().syncTree(path, true, null, newFilePath.split("/")[1]);
}

View File

@@ -97,22 +97,25 @@ namespace Umbraco.Web.WebServices
oldname = oldname.TrimStart(pathPrefix);
}
var view = get(svce, oldname);
if (view == null)
view = new PartialView(filename);
var currentView = oldname.IsNullOrWhiteSpace()
? get(svce, filename)
: get(svce, oldname);
if (currentView == null)
currentView = new PartialView(filename);
else
view.Path = filename;
view.Content = contents;
currentView.Path = filename;
currentView.Content = contents;
Attempt<IPartialView> attempt;
try
{
var partialView = view as PartialView;
var partialView = currentView as PartialView;
if (partialView != null && validate != null && validate(svce, partialView) == false)
return Failed(ui.Text("speechBubbles", "partialViewErrorText"), ui.Text("speechBubbles", "partialViewErrorHeader"),
new FileSecurityException("File '" + view.Path + "' is not a valid partial view file."));
new FileSecurityException("File '" + currentView.Path + "' is not a valid partial view file."));
attempt = save(svce, view);
attempt = save(svce, currentView);
}
catch (Exception e)
{