I am working on an umbraco migration/upgrade from 7.5.11 to 7.14.
I have got the site working and everything updated to the latest version.
I am currently running multiple sites in their own Application in IIS 10.
There is 1 main site running and then multiple sub applications.
Each umbraco instance has its own App Pool Setup and all is going smoothly.
When I try to save a Partial View that has already been created I get an error:
Server error: Contact administrator, see log for full details.
Failed to save data for code file /avonsom/Views/Partials/Grid/Bootstrap2-Fluid.cshtml
×
Validation: Validation errors must be fixed before the item can be saved
When I check the server logs, i see:
2019-04-26 15:43:25,208 [P11552/D7/T98] ERROR Umbraco.Web.Editors.CodeFileController - Unhandled controller exception occurred
Umbraco.Core.IO.FileSecurityException: File '/avonsomSearchResults.cshtml' is outside this filesystem's root.
at Umbraco.Core.IO.PhysicalFileSystem.GetFullPath(String path)
at Umbraco.Core.IO.PhysicalFileSystem.FileExists(String path)
at Umbraco.Core.Persistence.Repositories.PartialViewRepository.Get(String id)
at Umbraco.Core.Services.FileService.GetPartialViewMacro(String path)
at Umbraco.Web.Editors.CodeFileController.CreateOrUpdatePartialView(CodeFileDisplay display, String systemDirectory, Func2 getView, Func3 saveView, Func4 createView)
at Umbraco.Web.Editors.CodeFileController.CreateOrUpdatePartialViewMacro(CodeFileDisplay display)
at Umbraco.Web.Editors.CodeFileController.PostSave(CodeFileDisplay display)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
What could be the cause of this? Why is the directory different that it is saving to than the directory that the view is listed in? I can create a Partial View or Macro no problem in Umbraco. It allows me to save on the first try, but not if I try to save any additional changes to the Partial Views. EVERYTHING ELSE WORKS PERFECTLY. I am stuck. I have been searching for answers, but nothing seems to work. Anyone else run into this issue?
I fixed this by making a change to Umbraco Core.
I had to update the umbraco.resources.js file.
If you are running Umbraco in Sub Application on IIS 10.
You need to adjust the following line so it can save Partial Views.
save: function (codeFile) {
codeFile.virtualPath = codeFile.virtualPath.replace("/Virtual directoryName", "");
return umbRequestHelper.resourcePromise($http.post(umbRequestHelper.getApiUrl('codeFileApiBaseUrl', 'PostSave'), codeFile), 'Failed to save data for code file ' + codeFile.virtualPath);
},
Error Saving Partial Views in 7.14
Hello,
I am working on an umbraco migration/upgrade from 7.5.11 to 7.14.
I have got the site working and everything updated to the latest version.
I am currently running multiple sites in their own Application in IIS 10. There is 1 main site running and then multiple sub applications. Each umbraco instance has its own App Pool Setup and all is going smoothly.
When I try to save a Partial View that has already been created I get an error: Server error: Contact administrator, see log for full details. Failed to save data for code file /avonsom/Views/Partials/Grid/Bootstrap2-Fluid.cshtml × Validation: Validation errors must be fixed before the item can be saved
When I check the server logs, i see: 2019-04-26 15:43:25,208 [P11552/D7/T98] ERROR Umbraco.Web.Editors.CodeFileController - Unhandled controller exception occurred Umbraco.Core.IO.FileSecurityException: File '/avonsomSearchResults.cshtml' is outside this filesystem's root. at Umbraco.Core.IO.PhysicalFileSystem.GetFullPath(String path) at Umbraco.Core.IO.PhysicalFileSystem.FileExists(String path) at Umbraco.Core.Persistence.Repositories.PartialViewRepository.Get(String id) at Umbraco.Core.Services.FileService.GetPartialViewMacro(String path) at Umbraco.Web.Editors.CodeFileController.CreateOrUpdatePartialView(CodeFileDisplay display, String systemDirectory, Func
2 getView, Func
3 saveView, Func4 createView) at Umbraco.Web.Editors.CodeFileController.CreateOrUpdatePartialViewMacro(CodeFileDisplay display) at Umbraco.Web.Editors.CodeFileController.PostSave(CodeFileDisplay display) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary
2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown ---What could be the cause of this? Why is the directory different that it is saving to than the directory that the view is listed in? I can create a Partial View or Macro no problem in Umbraco. It allows me to save on the first try, but not if I try to save any additional changes to the Partial Views. EVERYTHING ELSE WORKS PERFECTLY. I am stuck. I have been searching for answers, but nothing seems to work. Anyone else run into this issue?
thanks in advance for your help.
I fixed this by making a change to Umbraco Core. I had to update the umbraco.resources.js file.
If you are running Umbraco in Sub Application on IIS 10. You need to adjust the following line so it can save Partial Views.
save: function (codeFile) { codeFile.virtualPath = codeFile.virtualPath.replace("/Virtual directoryName", ""); return umbRequestHelper.resourcePromise($http.post(umbRequestHelper.getApiUrl('codeFileApiBaseUrl', 'PostSave'), codeFile), 'Failed to save data for code file ' + codeFile.virtualPath); },
is working on a reply...