Cannot create alternate in the page

Topics: General, Troubleshooting
Apr 19, 2011 at 6:12 AM

Does anyone experience the error as below?

Server Error in '/OrchardLocal' Application.

The relative virtual path 'Orchard.Core.Shapes.CoreShapes::StylesheetLinks' is not allowed here.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: The relative virtual path 'Orchard.Core.Shapes.CoreShapes::StylesheetLinks' is not allowed here.

Source Error: 

Line 33: 
Line 34:             // use same extension as template, or ".cshtml" if it's a code template))
Line 35:             if (_webSiteFolder.FileExists(template)) {
Line 36:                 alternateFilename += Path.GetExtension(template);
Line 37: 


Source File: d:\IPSv1.1_CKEditor\Orchard\Modules\Orchard.DesignerTools\Controllers\AlternateController.cs    Line: 35 

Stack Trace: 

[ArgumentException: The relative virtual path 'Orchard.Core.Shapes.CoreShapes::StylesheetLinks' is not allowed here.]
   System.Web.VirtualPath.FailIfRelativePath() +8815612
   System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +49
   System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath) +42
   System.Web.Hosting.MapPathBasedVirtualPathProvider.CacheLookupOrInsert(String virtualPath, Boolean isFile) +38
   System.Web.Hosting.MapPathBasedVirtualPathProvider.FileExists(String virtualPath) +6
   Orchard.FileSystems.Dependencies.DynamicModuleVirtualPathProvider.FileExists(String virtualPath) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\FileSystems\Dependencies\DynamicModuleVirtualPathProvider.cs:34
   Orchard.FileSystems.Dependencies.WebFormVirtualPathProvider.FileExists(String virtualPath) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\FileSystems\Dependencies\WebFormsExtensionsVirtualPathProvider.cs:41
   Orchard.FileSystems.VirtualPath.DefaultVirtualPathProvider.FileExists(String virtualPath) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\FileSystems\VirtualPath\DefaultVirtualPathProvider.cs:61
   Orchard.FileSystems.WebSite.WebSiteFolder.FileExists(String virtualPath) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\FileSystems\WebSite\WebSiteFolder.cs:38
   Orchard.DesignerTools.Controllers.AlternateController.Create(String template, String alternate, String returnUrl) in d:\IPSv1.1_CKEditor\Orchard\Modules\Orchard.DesignerTools\Controllers\AlternateController.cs:35
   lambda_method(Closure , ControllerBase , Object[] ) +209
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\Mvc\Routes\ShellRoute.cs:148
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8862381
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225

 

 

Apr 20, 2011 at 2:04 PM

Yes; it happens when you try to create an Alternate for a shape that doesn't actually have a template, i.e. shapes that are rendered from code (mostly in CoreShapes.cs).

So yeah you get this if you try to use Create for Zones and a variety of other things.

I'd seen this and was going to raise a workitem, just hadn't got round to it.

Jun 23, 2011 at 6:03 PM

Anybody know how to resolve this error. I was trying to change the value in ThemeMachine stylesheet and not able to creat a alternative

Coordinator
Jun 23, 2011 at 7:29 PM

Actually, alternates work fine. It's when you attempt to override the core shape that this can happen. But in any case, what are you trying to accomplish here that requires overriding the stylesheet links?

Jun 23, 2011 at 10:17 PM

I am trying to use List module to display list horizontally. The way I am trying to do is to modify site.css of theme by changing the class "Content-items"  o li to {float:left}.

Jun 23, 2011 at 10:34 PM

Create your own theme using TheThemeMachine as the base theme, then just copy its Site.css to your theme's Styles folder and make whatever changes you need.