Is this a setting, appsetting, machine setting that I have wrong somehow? It is happening on a new single-language umbraco v14 install so it seems out of the box this way.
public class PreviewController : Controller
{
[HttpGet]
[Route("umbraco/preview")]
public IActionResult Index(string id)
{
var requestUrl = new Uri(Request.GetDisplayUrl());
var leftPart = requestUrl.GetLeftPart(UriPartial.Authority);
return new RedirectResult($"{leftPart}/{id}");
}
}
and in appsettings.json Umbraco Globals
"ReservedPaths": "~/umbraco/preview"
This also resolved some CORS errors the iframe was introducing, and strips off the &culture=invariant querystring that was causing the error. The drawback is you don't get the different device sizes footer menu.
An unhandled exception occurred while processing the request.
CultureNotFoundException: Culture is not supported. (Parameter 'name')
invariant is an invalid culture identifier.
Is Preview Broken in v14?
On both my v14 sites, when I click 'Save and Preview' I get sent to a page URL that ends with "&culture=invariant"
This results in an error:
CultureNotFoundException: Culture is not supported. (Parameter 'name') invariant is an invalid culture identifier.
If I hand-edit the url to include a culture instead of the word 'invariant' then the page opens fine.
I saw a couple other users here getting this error but their recent comments were buried at the bottom of an old post: https://our.umbraco.com/packages/backoffice-extensions/plumber-workflow-for-umbraco/plumber-workflow-for-umbraco-discussion-and-troubleshooting/108500-error-on-preview-culture-is-not-supported
Is this a setting, appsetting, machine setting that I have wrong somehow? It is happening on a new single-language umbraco v14 install so it seems out of the box this way.
To clarify, I'm running 14.0.2
Worked around this by adding intercepting and leap-frogging the 'Preview' iframe functionality based on an article https://adolfi.dev/blog/umbraco-preview/
and in appsettings.json Umbraco Globals
This also resolved some CORS errors the iframe was introducing, and strips off the &culture=invariant querystring that was causing the error. The drawback is you don't get the different device sizes footer menu.
I guess this is still broken I am getting this!
An unhandled exception occurred while processing the request. CultureNotFoundException: Culture is not supported. (Parameter 'name') invariant is an invalid culture identifier.
System.Globalization.CultureInfo.GetCultureInfo(string name)
At the time of posting this we are on 14.3.1
is working on a reply...