Merge pull request #8944 from umbraco/netcore/bugfix/8856-user_culture_not_used_everywhere
Netcore: Bugfix for user culture not used everywhere
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
public const string BackOfficePathSegment = "BackOffice"; // The path segment prefix for all back office controllers
|
||||
public const string BackOfficeArea = "UmbracoBackOffice"; // Used for area routes of non-api controllers
|
||||
public const string BackOfficeApiArea = "UmbracoApi"; // Same name as v8 so all routing remains the same
|
||||
public const string BackOfficeTreeArea = "UmbracoTrees"; // Same name as v8 so all routing remains the same
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ using Umbraco.Core.Services;
|
||||
using Umbraco.Tests.Common.Builders;
|
||||
using Umbraco.Tests.Common.Builders.Extensions;
|
||||
using Umbraco.Tests.Testing;
|
||||
using Umbraco.Web.BackOffice.Controllers;
|
||||
using Umbraco.Web.Common.Formatters;
|
||||
using Umbraco.Web.Editors;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
@@ -22,6 +22,7 @@ using Umbraco.Web.Common.Builder;
|
||||
using Umbraco.Web.Common.Controllers;
|
||||
using Umbraco.Web.Editors;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Umbraco.Web.BackOffice.Controllers;
|
||||
|
||||
namespace Umbraco.Tests.Integration.TestServerTest
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ using Umbraco.Web.Models.Mapping;
|
||||
using Umbraco.Web.Security;
|
||||
using Umbraco.Web.WebApi.Filters;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
namespace Umbraco.Web.BackOffice.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// The API controller used for editing content
|
||||
|
||||
@@ -4,7 +4,7 @@ using Umbraco.Core.Services;
|
||||
using Umbraco.Web.BackOffice.Controllers;
|
||||
using Umbraco.Web.Common.Attributes;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
namespace Umbraco.Web.BackOffice.Controllers
|
||||
{
|
||||
[PluginController("UmbracoApi")]
|
||||
public class IconController : UmbracoAuthorizedApiController
|
||||
|
||||
@@ -21,10 +21,11 @@ using Umbraco.Web.BackOffice.Controllers;
|
||||
using Umbraco.Web.BackOffice.Filters;
|
||||
using Umbraco.Web.Common.Attributes;
|
||||
using Umbraco.Web.Common.Exceptions;
|
||||
using Umbraco.Web.Editors;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
namespace Umbraco.Web.BackOffice.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// An API controller used for dealing with member types
|
||||
|
||||
@@ -15,7 +15,7 @@ using Umbraco.Web.Security;
|
||||
using Umbraco.Web.Services;
|
||||
using Umbraco.Web.Trees;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
namespace Umbraco.Web.BackOffice.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// The API controller used for using the list of sections
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Umbraco.Web.Trees
|
||||
/// Used to return tree root nodes
|
||||
/// </summary>
|
||||
[AngularJsonOnlyConfiguration]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
public class ApplicationTreeController : UmbracoAuthorizedApiController
|
||||
{
|
||||
private readonly ITreeService _treeService;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Umbraco.Web.Trees
|
||||
/// </remarks>
|
||||
[UmbracoApplicationAuthorize(Constants.Applications.Content)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.ContentBlueprints, SortOrder = 12, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class ContentBlueprintTreeController : TreeController
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Umbraco.Web.Trees
|
||||
Constants.Applications.Packages,
|
||||
Constants.Applications.Members)]
|
||||
[Tree(Constants.Applications.Content, Constants.Trees.Content)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
[SearchableTree("searchResultFormatter", "configureContentResult", 10)]
|
||||
public class ContentTreeController : ContentTreeControllerBase, ISearchableTree
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.DocumentTypes)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.DocumentTypes, SortOrder = 0, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class ContentTypeTreeController : TreeController, ISearchableTree
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.DataTypes)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.DataTypes, SortOrder = 3, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class DataTypeTreeController : TreeController, ISearchableTree
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Umbraco.Web.Trees
|
||||
// We are allowed to see the dictionary tree, if we are allowed to manage templates, such that se can use the
|
||||
// dictionary items in templates, even when we dont have authorization to manage the dictionary items
|
||||
)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
[Tree(Constants.Applications.Translation, Constants.Trees.Dictionary, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
public class DictionaryTreeController : TreeController
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.Languages)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.Languages, SortOrder = 11, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class LanguageTreeController : TreeController
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.LogViewer)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.LogViewer, SortOrder= 9, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class LogViewerTreeController : TreeController
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.Macros)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.Macros, TreeTitle = "Macros", SortOrder = 4, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class MacrosTreeController : TreeController
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Umbraco.Web.Trees
|
||||
Constants.Applications.Packages,
|
||||
Constants.Applications.Members)]
|
||||
[Tree(Constants.Applications.Media, Constants.Trees.Media)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
[SearchableTree("searchResultFormatter", "configureMediaResult", 20)]
|
||||
public class MediaTreeController : ContentTreeControllerBase, ISearchableTree, ITreeNodeController
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.MediaTypes)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.MediaTypes, SortOrder = 1, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class MediaTypeTreeController : TreeController, ISearchableTree
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.MemberGroups)]
|
||||
[Tree(Constants.Applications.Members, Constants.Trees.MemberGroups, SortOrder = 1)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class MemberGroupTreeController : MemberTypeAndGroupTreeControllerBase
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Umbraco.Web.Trees
|
||||
Constants.Applications.Media,
|
||||
Constants.Applications.Members)]
|
||||
[Tree(Constants.Applications.Members, Constants.Trees.Members, SortOrder = 0)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
[SearchableTree("searchResultFormatter", "configureMemberResult")]
|
||||
public class MemberTreeController : TreeController, ISearchableTree, ITreeNodeController
|
||||
|
||||
@@ -10,7 +10,7 @@ using Umbraco.Web.WebApi;
|
||||
|
||||
namespace Umbraco.Web.Trees
|
||||
{
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public abstract class MemberTypeAndGroupTreeControllerBase : TreeController
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Umbraco.Web.Trees
|
||||
[CoreTree]
|
||||
[UmbracoTreeAuthorize(Constants.Trees.MemberTypes)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.MemberTypes, SortOrder = 2, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
public class MemberTypeTreeController : MemberTypeAndGroupTreeControllerBase, ISearchableTree
|
||||
{
|
||||
private readonly UmbracoTreeSearcher _treeSearcher;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.Packages)]
|
||||
[Tree(Constants.Applications.Packages, Constants.Trees.Packages, SortOrder = 0, IsSingleNodeTree = true)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class PackagesTreeController : TreeController
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Umbraco.Web.Trees
|
||||
/// </summary>
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.PartialViewMacros, SortOrder = 8, TreeGroup = Constants.Trees.Groups.Templating)]
|
||||
[UmbracoTreeAuthorize(Constants.Trees.PartialViewMacros)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class PartialViewMacrosTreeController : PartialViewsTreeController
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Umbraco.Web.Trees
|
||||
/// </summary>
|
||||
[Tree(Core.Constants.Applications.Settings, Core.Constants.Trees.PartialViews, SortOrder = 7, TreeGroup = Core.Constants.Trees.Groups.Templating)]
|
||||
[UmbracoTreeAuthorize(Constants.Trees.PartialViews)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class PartialViewsTreeController : FileSystemTreeController
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.RelationTypes)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.RelationTypes, SortOrder = 5, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class RelationTypeTreeController : TreeController
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.Templates)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.Templates, SortOrder = 6, TreeGroup = Constants.Trees.Groups.Templating)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class TemplatesTreeController : TreeController, ISearchableTree
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.Users)]
|
||||
[Tree(Constants.Applications.Users, Constants.Trees.Users, SortOrder = 0, IsSingleNodeTree = true)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
|
||||
[CoreTree]
|
||||
public class UserTreeController : TreeController
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Umbraco.Web.Common.ApplicationModels
|
||||
public BackOfficeApplicationModelProvider(IModelMetadataProvider modelMetadataProvider)
|
||||
{
|
||||
ActionModelConventions = new List<IActionModelConvention>()
|
||||
{
|
||||
{
|
||||
new BackOfficeIdentityCultureConvention()
|
||||
};
|
||||
}
|
||||
@@ -52,7 +52,9 @@ namespace Umbraco.Web.Common.ApplicationModels
|
||||
{
|
||||
var pluginControllerAttribute = controller.Attributes.OfType<PluginControllerAttribute>().FirstOrDefault();
|
||||
return pluginControllerAttribute != null
|
||||
&& pluginControllerAttribute.AreaName == Core.Constants.Web.Mvc.BackOfficeArea;
|
||||
&& (pluginControllerAttribute.AreaName == Core.Constants.Web.Mvc.BackOfficeArea
|
||||
|| pluginControllerAttribute.AreaName == Core.Constants.Web.Mvc.BackOfficeApiArea
|
||||
|| pluginControllerAttribute.AreaName == Core.Constants.Web.Mvc.BackOfficeTreeArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Umbraco.Web.Common.Filters
|
||||
{
|
||||
public void OnActionExecuted(ActionExecutedContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnActionExecuting(ActionExecutingContext context)
|
||||
|
||||
Reference in New Issue
Block a user