From 8adea3b1e916029d97ab59a772929b0dc8dd44df Mon Sep 17 00:00:00 2001 From: Sergey Koshelev Date: Mon, 11 Nov 2024 15:27:48 +0300 Subject: [PATCH] #7403 Removed the problematic pathBase code until we find a solution with local links --- src/Libraries/Nop.Core/Configuration/HostingConfig.cs | 7 +------ .../Infrastructure/NopRoutingStartup.cs | 6 ------ .../Migrations/UpgradeTo480/LocalizationMigration.cs | 3 --- .../App_Data/Localization/defaultResources.nopres.xml | 8 +------- .../Areas/Admin/Models/Settings/HostingConfigModel.cs | 3 --- .../Admin/Views/Setting/_AppSettings.Hosting.cshtml | 9 --------- .../Areas/Admin/Views/Shared/_AdminLayout.cshtml | 9 +-------- .../Areas/Admin/Views/Shared/_AdminPopupLayout.cshtml | 7 +------ src/Presentation/Nop.Web/Views/Install/Index.cshtml | 8 +------- src/Presentation/Nop.Web/Views/Shared/_Print.cshtml | 6 ------ .../Nop.Web/Views/Shared/_Root.Head.cshtml | 10 ++-------- 11 files changed, 7 insertions(+), 69 deletions(-) diff --git a/src/Libraries/Nop.Core/Configuration/HostingConfig.cs b/src/Libraries/Nop.Core/Configuration/HostingConfig.cs index 75be215b257..f9bf174a549 100644 --- a/src/Libraries/Nop.Core/Configuration/HostingConfig.cs +++ b/src/Libraries/Nop.Core/Configuration/HostingConfig.cs @@ -28,10 +28,5 @@ public partial class HostingConfig : IConfig /// /// Gets or sets addresses of known networks to accept forwarded headers from /// - public string KnownNetworks { get; protected set; } = string.Empty; - - /// - /// Ability to set a custom path base, for example domain.com/path/ - /// - public string PathBase { get; protected set; } = "/"; + public string KnownNetworks { get; protected set; } = string.Empty; } \ No newline at end of file diff --git a/src/Presentation/Nop.Web.Framework/Infrastructure/NopRoutingStartup.cs b/src/Presentation/Nop.Web.Framework/Infrastructure/NopRoutingStartup.cs index 3fa55f23e6e..b73936ed405 100644 --- a/src/Presentation/Nop.Web.Framework/Infrastructure/NopRoutingStartup.cs +++ b/src/Presentation/Nop.Web.Framework/Infrastructure/NopRoutingStartup.cs @@ -26,12 +26,6 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config /// Builder for configuring an application's request pipeline public void Configure(IApplicationBuilder application) { - var hostingConfig = Singleton.Instance.Get(); - - //use path base - if (!string.IsNullOrEmpty(hostingConfig.PathBase)) - application.UsePathBase(hostingConfig.PathBase); - //add the RoutingMiddleware application.UseRouting(); diff --git a/src/Presentation/Nop.Web.Framework/Migrations/UpgradeTo480/LocalizationMigration.cs b/src/Presentation/Nop.Web.Framework/Migrations/UpgradeTo480/LocalizationMigration.cs index 202f0e9547e..71d4c348d7d 100644 --- a/src/Presentation/Nop.Web.Framework/Migrations/UpgradeTo480/LocalizationMigration.cs +++ b/src/Presentation/Nop.Web.Framework/Migrations/UpgradeTo480/LocalizationMigration.cs @@ -274,9 +274,6 @@ public override void Up() //#7299 ["Admin.Catalog.Products.Multimedia.Videos.Description"] = "How to embed a video: Find your video in your library (on any video hosting) and select it to open the video settings page. Select the privacy icon from your \"Share\" button. Click on \"Embed\" from the window that opens up. You can copy the src from the embed option and use it.", - //path base - ["Admin.Configuration.AppSettings.Hosting.PathBase"] = "Path base", - ["Admin.Configuration.AppSettings.Hosting.PathBase.Hint"] = "Ability to set a custom path base, for example domain.com/path/", //4306 ["Admin.Configuration.Settings.Catalog.ShowSearchBoxCategories"] = "Show product categories for the search box", ["Admin.Configuration.Settings.Catalog.ShowSearchBoxCategories.Hint"] = "Check to display the drop-down list with product categories next to the search box.", diff --git a/src/Presentation/Nop.Web/App_Data/Localization/defaultResources.nopres.xml b/src/Presentation/Nop.Web/App_Data/Localization/defaultResources.nopres.xml index f573129236a..fec5ffb2890 100644 --- a/src/Presentation/Nop.Web/App_Data/Localization/defaultResources.nopres.xml +++ b/src/Presentation/Nop.Web/App_Data/Localization/defaultResources.nopres.xml @@ -4667,13 +4667,7 @@ Specify a list of IP CIDR notations (comma separated) to accept forwarded headers. e.g. 172.64.0.0/13,162.158.0.0/15 - - - Path base - - - Ability to set a custom path base, for example domain.com/path/ - + Use proxy servers diff --git a/src/Presentation/Nop.Web/Areas/Admin/Models/Settings/HostingConfigModel.cs b/src/Presentation/Nop.Web/Areas/Admin/Models/Settings/HostingConfigModel.cs index 25206d4788c..33ff17ff140 100644 --- a/src/Presentation/Nop.Web/Areas/Admin/Models/Settings/HostingConfigModel.cs +++ b/src/Presentation/Nop.Web/Areas/Admin/Models/Settings/HostingConfigModel.cs @@ -25,8 +25,5 @@ public partial record HostingConfigModel : BaseNopModel, IConfigModel [NopResourceDisplayName("Admin.Configuration.AppSettings.Hosting.KnownNetworks")] public string KnownNetworks { get; set; } - [NopResourceDisplayName("Admin.Configuration.AppSettings.Hosting.PathBase")] - public string PathBase { get; set; } = "/"; - #endregion } \ No newline at end of file diff --git a/src/Presentation/Nop.Web/Areas/Admin/Views/Setting/_AppSettings.Hosting.cshtml b/src/Presentation/Nop.Web/Areas/Admin/Views/Setting/_AppSettings.Hosting.cshtml index 72ac3a0a4dc..088cc91ae2f 100644 --- a/src/Presentation/Nop.Web/Areas/Admin/Views/Setting/_AppSettings.Hosting.cshtml +++ b/src/Presentation/Nop.Web/Areas/Admin/Views/Setting/_AppSettings.Hosting.cshtml @@ -48,13 +48,4 @@ -
-
- -
-
- - -
-
\ No newline at end of file diff --git a/src/Presentation/Nop.Web/Areas/Admin/Views/Shared/_AdminLayout.cshtml b/src/Presentation/Nop.Web/Areas/Admin/Views/Shared/_AdminLayout.cshtml index 256c16e7ab8..3c467cdbddc 100644 --- a/src/Presentation/Nop.Web/Areas/Admin/Views/Shared/_AdminLayout.cshtml +++ b/src/Presentation/Nop.Web/Areas/Admin/Views/Shared/_AdminLayout.cshtml @@ -6,11 +6,9 @@ @inject LocalizationSettings localizationSettings @inject StoreInformationSettings storeInformationSettings @inject Nop.Services.Localization.ILanguageService languageService -@inject AppSettings appSettings @using Nop.Core.Domain @using Nop.Core.Domain.Localization -@using Nop.Core.Configuration @using Nop.Services.Customers @using Nop.Services.Helpers @using Nop.Services.Security @@ -28,10 +26,7 @@ //avatar var currentCustomer = await workContext.GetCurrentCustomerAsync(); - - // Custom path base - var usePathBase = appSettings.Get().PathBase; - + //event await eventPublisher.PublishAsync(new PageRenderingEvent(NopHtml)); @@ -43,8 +38,6 @@ @adminPageTitle - - @NopHtml.GenerateHeadCustom() diff --git a/src/Presentation/Nop.Web/Areas/Admin/Views/Shared/_AdminPopupLayout.cshtml b/src/Presentation/Nop.Web/Areas/Admin/Views/Shared/_AdminPopupLayout.cshtml index 832aca6ca67..efb422b4b6a 100644 --- a/src/Presentation/Nop.Web/Areas/Admin/Views/Shared/_AdminPopupLayout.cshtml +++ b/src/Presentation/Nop.Web/Areas/Admin/Views/Shared/_AdminPopupLayout.cshtml @@ -1,16 +1,13 @@ @inject IEventPublisher eventPublisher @inject LocalizationSettings localizationSettings -@inject AppSettings appSettings @using Nop.Core.Domain.Localization -@using Nop.Core.Configuration + @{ //page title string adminPageTitle = !string.IsNullOrWhiteSpace(ViewBag.PageTitle) ? ViewBag.PageTitle + " / " : ""; adminPageTitle += T("Admin.PageTitle").Text; - var usePathBase = appSettings.Get().PathBase; - //event await eventPublisher.PublishAsync(new PageRenderingEvent(NopHtml)); } @@ -21,8 +18,6 @@ - - @NopHtml.GenerateHeadCustom() @* CSS & Script resources *@ diff --git a/src/Presentation/Nop.Web/Views/Install/Index.cshtml b/src/Presentation/Nop.Web/Views/Install/Index.cshtml index be00fe2332c..8fec1261314 100644 --- a/src/Presentation/Nop.Web/Views/Install/Index.cshtml +++ b/src/Presentation/Nop.Web/Views/Install/Index.cshtml @@ -1,20 +1,14 @@ @model InstallModel -@inject AppSettings appSettings - -@using Nop.Core.Configuration @{ Layout = null; - var usePathBase = appSettings.Get().PathBase; } @ILS.GetResource("Title") - - - + diff --git a/src/Presentation/Nop.Web/Views/Shared/_Print.cshtml b/src/Presentation/Nop.Web/Views/Shared/_Print.cshtml index 8f39e04f846..866e7601861 100644 --- a/src/Presentation/Nop.Web/Views/Shared/_Print.cshtml +++ b/src/Presentation/Nop.Web/Views/Shared/_Print.cshtml @@ -1,13 +1,9 @@ @inject Nop.Core.Domain.Common.CommonSettings commonSettings @inject IThemeContext themeContext -@inject AppSettings appSettings - -@using Nop.Core.Configuration @{ var themeName = await themeContext.GetWorkingThemeNameAsync(); var title = await NopHtml.GenerateTitleAsync(); - var usePathBase = appSettings.Get().PathBase; } @@ -15,8 +11,6 @@ @title - - @NopHtml.GenerateCssFiles() diff --git a/src/Presentation/Nop.Web/Views/Shared/_Root.Head.cshtml b/src/Presentation/Nop.Web/Views/Shared/_Root.Head.cshtml index 7989f309cb7..a2624fa1f51 100644 --- a/src/Presentation/Nop.Web/Views/Shared/_Root.Head.cshtml +++ b/src/Presentation/Nop.Web/Views/Shared/_Root.Head.cshtml @@ -1,5 +1,4 @@ -@using Nop.Core.Configuration -@using Nop.Core.Domain.Catalog +@using Nop.Core.Domain.Catalog @using Nop.Core.Domain.Common @using Nop.Core.Domain.Seo @using Nop.Services.Security @@ -10,7 +9,6 @@ @inject IEventPublisher eventPublisher @inject IPermissionService permissionService @inject SeoSettings seoSettings -@inject AppSettings appSettings @{ if (catalogSettings.DisplayAllPicturesOnCatalogPages) @@ -39,9 +37,7 @@ { NopHtml.AppendHeadCustomParts(seoSettings.CustomHeadTags); } - - var usePathBase = appSettings.Get().PathBase; - + //event await eventPublisher.PublishAsync(new PageRenderingEvent(NopHtml)); @@ -54,8 +50,6 @@ @title - -