diff --git a/src/Libraries/Nop.Services/Installation/CodeFirstInstallationService.cs b/src/Libraries/Nop.Services/Installation/CodeFirstInstallationService.cs index 13a4a85bc77..670bca3f14c 100644 --- a/src/Libraries/Nop.Services/Installation/CodeFirstInstallationService.cs +++ b/src/Libraries/Nop.Services/Installation/CodeFirstInstallationService.cs @@ -6177,6 +6177,7 @@ protected virtual void InstallSettings() "config", "eucookielawaccept", "page-not-found", + "products", //system names are not allowed (anyway they will cause a runtime error), "con", "lpt1", diff --git a/upgradescripts/4.20-4.30/upgrade.sql b/upgradescripts/4.20-4.30/upgrade.sql index 77d4684891f..1f147dca9e7 100644 --- a/upgradescripts/4.20-4.30/upgrade.sql +++ b/upgradescripts/4.20-4.30/upgrade.sql @@ -3348,4 +3348,22 @@ IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = object_id(N'[StorePic BEGIN DELETE FROM [MigrationVersionInfo] WHERE [Description] = 'Pickup.PickupInStore base schema'; END +GO + +--add new slug to "reservedurlrecordslugs" setting +IF EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'seosettings.reservedurlrecordslugs') +BEGIN + DECLARE @NewUrlRecord nvarchar(4000) + SET @NewUrlRecord = N'products' + + DECLARE @reservedurlrecordslugs nvarchar(4000) + SELECT @reservedurlrecordslugs = [Value] FROM [Setting] WHERE [name] = N'seosettings.reservedurlrecordslugs' + + IF (PATINDEX('%[,]' + @NewUrlRecord + '[,]%', @reservedurlrecordslugs) = 0 or PATINDEX('%[,]' + @NewUrlRecord, @reservedurlrecordslugs) = 0) + BEGIN + UPDATE [Setting] + SET [Value] = @reservedurlrecordslugs + ',' + @NewUrlRecord + WHERE [name] = N'seosettings.reservedurlrecordslugs' + END +END GO \ No newline at end of file