Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Move media store setting to the new storage settings (managed in System settings) #158

KrzysztofPajak5f2f0d3af2be
diff --git a/src/Business/Grand.Business.Storage/Services/AmazonPictureService.cs b/src/Business/Grand.Business.Storage/Services/AmazonPictureService.cs
index aede95436..dc358167c 100644
--- a/src/Business/Grand.Business.Storage/Services/AmazonPictureService.cs
+++ b/src/Business/Grand.Business.Storage/Services/AmazonPictureService.cs
@@ -43,6 +43,7 @@ namespace Grand.Business.Storage.Services
ICacheBase cacheBase,
IMediaFileStore mediaFileStore,
MediaSettings mediaSettings,
+ StorageSettings storageSettings,
AppConfig config)
: base(pictureRepository,
logger,
@@ -51,7 +52,8 @@ namespace Grand.Business.Storage.Services
workContext,
cacheBase,
mediaFileStore,
- mediaSettings)
+ mediaSettings,
+ storageSettings)
{
_config = config;
diff --git a/src/Business/Grand.Business.Storage/Services/AzurePictureService.cs b/src/Business/Grand.Business.Storage/Services/AzurePictureService.cs
index fbed97290..e5f5b7cb9 100644
--- a/src/Business/Grand.Business.Storage/Services/AzurePictureService.cs
+++ b/src/Business/Grand.Business.Storage/Services/AzurePictureService.cs
@@ -37,6 +37,7 @@ namespace Grand.Business.Storage.Services
ICacheBase cacheBase,
IMediaFileStore mediaFileStore,
MediaSettings mediaSettings,
+ StorageSettings storageSettings,
AppConfig config)
: base(pictureRepository,
logger,
@@ -45,7 +46,8 @@ namespace Grand.Business.Storage.Services
workContext,
cacheBase,
mediaFileStore,
- mediaSettings)
+ mediaSettings,
+ storageSettings)
{
_config = config;
diff --git a/src/Business/Grand.Business.Storage/Services/PictureService.cs b/src/Business/Grand.Business.Storage/Services/PictureService.cs
index e45045dae..c5d982dc3 100644
--- a/src/Business/Grand.Business.Storage/Services/PictureService.cs
+++ b/src/Business/Grand.Business.Storage/Services/PictureService.cs
@@ -38,6 +38,7 @@ namespace Grand.Business.Storage.Services
private readonly ICacheBase _cacheBase;
private readonly IMediaFileStore _mediaFileStore;
private readonly MediaSettings _mediaSettings;
+ private readonly StorageSettings _storageSettings;
//Used when images stored on file system
private readonly string _imagePath;
@@ -70,7 +71,8 @@ namespace Grand.Business.Storage.Services
IWorkContext workContext,
ICacheBase cacheBase,
IMediaFileStore mediaFileStore,
- MediaSettings mediaSettings)
+ MediaSettings mediaSettings,
+ StorageSettings storageSettings)
{
_pictureRepository = pictureRepository;
_logger = logger;
@@ -80,6 +82,7 @@ namespace Grand.Business.Storage.Services
_cacheBase = cacheBase;
_mediaFileStore = mediaFileStore;
_mediaSettings = mediaSettings;
+ _storageSettings = storageSettings;
_imagePath = _mediaFileStore.Combine("assets", "images");
_thumbPath = _mediaFileStore.Combine("assets", "images", "thumbs");
@@ -264,7 +267,7 @@ namespace Grand.Business.Storage.Services
/// <returns>Picture binary</returns>
public virtual async Task<byte[]> LoadPictureBinary(Picture picture)
{
- return await LoadPictureBinary(picture, _mediaSettings.StoreInDb);
+ return await LoadPictureBinary(picture, _storageSettings.PictureStoreInDb);
}
/// <summary>
@@ -495,7 +498,7 @@ namespace Grand.Business.Storage.Services
await DeletePictureThumbs(picture);
//delete from file system
- if (!_mediaSettings.StoreInDb)
+ if (!_storageSettings.PictureStoreInDb)
await DeletePictureOnFileSystem(picture);
//delete from database
@@ -587,7 +590,7 @@ namespace Grand.Business.Storage.Services
pictureBinary = ValidatePicture(pictureBinary, mimeType);
var picture = new Picture {
- PictureBinary = _mediaSettings.StoreInDb ? pictureBinary : new byte[0],
+ PictureBinary = _storageSettings.PictureStoreInDb ? pictureBinary : new byte[0],
MimeType = mimeType,
SeoFilename = seoFilename,
AltAttribute = altAttribute,
@@ -598,7 +601,7 @@ namespace Grand.Business.Storage.Services
};
await _pictureRepository.InsertAsync(picture);
- if (!_mediaSettings.StoreInDb)
+ if (!_storageSettings.PictureStoreInDb)
await SavePictureInFile(picture.Id, pictureBinary, mimeType);
//event notification
@@ -641,7 +644,7 @@ namespace Grand.Business.Storage.Services
if (pictureBinary != null)
{
- picture.PictureBinary = _mediaSettings.StoreInDb ? pictureBinary : Array.Empty<byte>();
+ picture.PictureBinary = _storageSettings.PictureStoreInDb ? pictureBinary : Array.Empty<byte>();
await _pictureRepository.UpdateField(picture.Id, x => x.PictureBinary, picture.PictureBinary);
}
@@ -660,7 +663,7 @@ namespace Grand.Business.Storage.Services
picture.IsNew = isNew;
await _pictureRepository.UpdateField(picture.Id, x => x.IsNew, picture.IsNew);
- if (!_mediaSettings.StoreInDb && pictureBinary != null)
+ if (!_storageSettings.PictureStoreInDb && pictureBinary != null)
await SavePictureInFile(picture.Id, pictureBinary, mimeType);
//event notification
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs b/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs
index 7f1b1d131..65f045853 100644
--- a/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs
+++ b/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs
@@ -96,9 +96,12 @@ namespace Grand.Business.System.Services.Installation
ImageQuality = 100,
DefaultPictureZoomEnabled = true,
StoreLocation = "/",
- StoreInDb = true
});
+ await _settingService.SaveSetting(new StorageSettings {
+ PictureStoreInDb = true
+ });
+
await _settingService.SaveSetting(new SeoSettings {
PageTitleSeparator = ". ",
PageTitleSeoAdjustment = true,
diff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateMediaSettings.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateMediaSettings.cs
new file mode 100644
index 000000000..97f15c2aa
--- /dev/null
+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateMediaSettings.cs
@@ -0,0 +1,62 @@
+using Grand.Business.Common.Interfaces.Configuration;
+using Grand.Business.Common.Interfaces.Logging;
+using Grand.Domain.Data;
+using Grand.Domain.Media;
+using Grand.Infrastructure.Migrations;
+using Microsoft.Extensions.DependencyInjection;
+using System;
+using System.Linq;
+using System.Text.Json;
+
+namespace Grand.Business.System.Services.Migrations._1._1
+{
+ public class MigrationUpdateMediaSettings : IMigration
+ {
+
+ public int Priority => 0;
+
+ public DbVersion Version => new(1, 1);
+
+ public Guid Identity => new("899F6A9F-99BA-41C1-8E1F-9AE63A78E531");
+
+ public string Name => "Update media settings - add new settings storage settings";
+
+ /// <summary>
+ /// Upgrade process
+ /// </summary>
+ /// <param name="database"></param>
+ /// <param name="serviceProvider"></param>
+ /// <returns></returns>
+ public bool UpgradeProcess(IDatabaseContext database, IServiceProvider serviceProvider)
+ {
+ var repository = serviceProvider.GetRequiredService<IRepository<Domain.Configuration.Setting>>();
+ var mediaSettings = repository.Table.FirstOrDefault(x => x.Name == "mediasettings");
+ var settingService = serviceProvider.GetRequiredService<ISettingService>();
+ var logService = serviceProvider.GetRequiredService<ILogger>();
+
+ try
+ {
+ if (mediaSettings != null)
+ {
+ var metadata = mediaSettings.Metadata;
+ var settingsLogo = JsonSerializer.Deserialize<SettingsMedia>(metadata);
+ if (settingsLogo != null)
+ {
+ settingService.SaveSetting<StorageSettings>(new StorageSettings() { PictureStoreInDb = settingsLogo.StoreInDb }, "").GetAwaiter().GetResult();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ logService.InsertLog(Domain.Logging.LogLevel.Error, "UpgradeProcess - MigrationUpdateMediaSettings", ex.Message).GetAwaiter().GetResult();
+ }
+ return true;
+ }
+
+ private class SettingsMedia
+ {
+ public bool StoreInDb { get; set; }
+ }
+
+ }
+}
diff --git a/src/Core/Grand.Domain/Media/MediaSettings.cs b/src/Core/Grand.Domain/Media/MediaSettings.cs
index eef6beb9a..19b3fa4ff 100644
--- a/src/Core/Grand.Domain/Media/MediaSettings.cs
+++ b/src/Core/Grand.Domain/Media/MediaSettings.cs
@@ -38,9 +38,5 @@ namespace Grand.Domain.Media
public string StoreLocation { get; set; }
- /// <summary>
- /// Gets a value indicating whether the images should be stored in data base.
- /// </summary>
- public bool StoreInDb { get; set; } = true;
}
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Media/StorageSettings.cs b/src/Core/Grand.Domain/Media/StorageSettings.cs
new file mode 100644
index 000000000..fed2a11de
--- /dev/null
+++ b/src/Core/Grand.Domain/Media/StorageSettings.cs
@@ -0,0 +1,12 @@
+using Grand.Domain.Configuration;
+
+namespace Grand.Domain.Media
+{
+ public class StorageSettings : ISettings
+ {
+ /// <summary>
+ /// Gets a value indicating whether the images should be stored in data base.
+ /// </summary>
+ public bool PictureStoreInDb { get; set; } = true;
+ }
+}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Storage.Tests/Services/PictureServiceTests.cs b/src/Tests/Grand.Business.Storage.Tests/Services/PictureServiceTests.cs
index c6f9f97c9..e652d7453 100644
--- a/src/Tests/Grand.Business.Storage.Tests/Services/PictureServiceTests.cs
+++ b/src/Tests/Grand.Business.Storage.Tests/Services/PictureServiceTests.cs
@@ -27,6 +27,7 @@ namespace Grand.Business.Storage.Tests.Services
private Mock<IMediaFileStore> _mediaFileStoreMock;
private MediaSettings _settings;
+ private StorageSettings _storagesettings;
private PictureService _service;
[TestInitialize]
@@ -40,8 +41,9 @@ namespace Grand.Business.Storage.Tests.Services
_cacheMock = new Mock<ICacheBase>();
_mediaFileStoreMock = new Mock<IMediaFileStore>();
_settings = new MediaSettings();
+ _storagesettings = new StorageSettings();
_service = new PictureService(_repoMock.Object, _logerMock.Object, _mediatorMock.Object, _webHostMock.Object, _workContextMock.Object
- , _cacheMock.Object, _mediaFileStoreMock.Object, _settings);
+ , _cacheMock.Object, _mediaFileStoreMock.Object, _settings, _storagesettings);
}
[TestMethod]
@@ -72,7 +74,7 @@ namespace Grand.Business.Storage.Tests.Services
[TestMethod]
public async Task InsertPicture_InvokeExpectedMethods()
{
- _settings.StoreInDb = true;
+ _storagesettings.PictureStoreInDb = true;
await _service.InsertPicture(new byte[] { }, "image/jpeg", "image", validateBinary: false);
_repoMock.Verify(c => c.InsertAsync(It.IsAny<Picture>()), Times.Once);
_mediatorMock.Verify(c => c.Publish(It.IsAny<EntityInserted<Picture>>(), default), Times.Once);
@@ -81,7 +83,7 @@ namespace Grand.Business.Storage.Tests.Services
[TestMethod]
public async Task UpdatePicture_InvokeExpectedMethods()
{
- _settings.StoreInDb = true;
+ _storagesettings.PictureStoreInDb = true;
await _service.UpdatePicture(new Picture());
_repoMock.Verify(c => c.UpdateAsync(It.IsAny<Picture>()), Times.Once);
_mediatorMock.Verify(c => c.Publish(It.IsAny<EntityUpdated<Picture>>(), default), Times.Once);
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Media.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Media.cshtml
index d309bb998..b453e4699 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Media.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Media.cshtml
@@ -25,28 +25,6 @@
<vc:admin-widget widget-zone="media_settings_top" additional-data="null" />
<div class="form-horizontal">
<div class="form-body">
- <div class="form-group">
- <div class="col-8 col-md-4 col-sm-4 text-right">
- <admin-label asp-for="PicturesStoredIntoDatabase" class="control-label" />
- </div>
- <div class="col-4 col-md-8 col-sm-8">
- <div class="note note-info">
- @if (Model.PicturesStoredIntoDatabase)
- {
- @Loc["Admin.Settings.Media.PicturesStoredIntoDatabase.Database"]
- }
- else
- {
- @Loc["Admin.Settings.Media.PicturesStoredIntoDatabase.FileSystem"]
- }
- </div>
- <button type="submit" name="change-picture-storage" asp-action="ChangePictureStorage" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]');" class="k-button"><span class="k-icon k-i-rotate"></span>&nbsp;@Loc["Admin.Settings.Media.PicturesStoredIntoDatabase.Change"]</button>
- <p>&nbsp;</p>
- <div class="note note-warning">
- <span>@Loc["Admin.Settings.Media.PicturesStoredIntoDatabase.Note"]</span>
- </div>
- </div>
- </div>
<div class="form-group">
<div class="col-8 col-md-4 col-sm-4 text-right">
<admin-label asp-for="ProductThumbPictureSize" class="control-label" />
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/SystemSetting.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/SystemSetting.cshtml
index 3c953dd07..8b24451a2 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/SystemSetting.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/SystemSetting.cshtml
@@ -63,6 +63,30 @@
</div>
</div>
</div>
+ <div class="form-body">
+ <div class="form-group">
+ <div class="col-8 col-md-4 col-sm-4 text-right">
+ <admin-label asp-for="PicturesStoredIntoDatabase" class="control-label" />
+ </div>
+ <div class="col-4 col-md-8 col-sm-8">
+ <div class="note note-info">
+ @if (Model.PicturesStoredIntoDatabase)
+ {
+ @Loc["Admin.Settings.Media.PicturesStoredIntoDatabase.Database"]
+ }
+ else
+ {
+ @Loc["Admin.Settings.Media.PicturesStoredIntoDatabase.FileSystem"]
+ }
+ </div>
+ <button type="submit" name="change-picture-storage" asp-action="ChangePictureStorage" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]');" class="k-button"><span class="k-icon k-i-rotate"></span>&nbsp;@Loc["Admin.Settings.Media.PicturesStoredIntoDatabase.Change"]</button>
+ <p>&nbsp;</p>
+ <div class="note note-warning">
+ <span>@Loc["Admin.Settings.Media.PicturesStoredIntoDatabase.Note"]</span>
+ </div>
+ </div>
+ </div>
+ </div>
<div class="form-group">
<div class="col-8 col-md-4 col-sm-4 text-right">
<admin-label asp-for="UseIsoDateTimeConverterInJson" class="control-label" />
diff --git a/src/Web/Grand.Web.Admin/Controllers/CommonController.cs b/src/Web/Grand.Web.Admin/Controllers/CommonController.cs
index 6852682fe..cdb4ea16b 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CommonController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CommonController.cs
@@ -358,12 +358,13 @@ namespace Grand.Web.Admin.Controllers
[HttpPost]
public async Task<IActionResult> MaintenanceConvertPicture(
- [FromServices] IPictureService pictureService,
+ [FromServices] IPictureService pictureService,
+ [FromServices] StorageSettings storageSettings,
[FromServices] MediaSettings mediaSettings,
[FromServices] ILogger logger)
{
var numberOfConvertItems = 0;
- if (mediaSettings.StoreInDb)
+ if (storageSettings.PictureStoreInDb)
{
var pictures = pictureService.GetPictures();
foreach (var picture in pictures)
diff --git a/src/Web/Grand.Web.Admin/Controllers/SettingController.cs b/src/Web/Grand.Web.Admin/Controllers/SettingController.cs
index 5de881036..80b952b9f 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SettingController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SettingController.cs
@@ -557,8 +557,6 @@ namespace Grand.Web.Admin.Controllers
var model = mediaSettings.ToModel();
model.ActiveStore = storeScope;
- var mediaStoreSetting = _settingService.LoadSetting<MediaSettings>("");
- model.PicturesStoredIntoDatabase = mediaStoreSetting.StoreInDb;
return View(model);
}
@@ -586,68 +584,6 @@ namespace Grand.Web.Admin.Controllers
return RedirectToAction("Media");
}
- [HttpPost]
- public async Task<IActionResult> ChangePictureStorage()
- {
- var mediaSettings = _settingService.LoadSetting<MediaSettings>();
- var storeIdDb = !mediaSettings.StoreInDb;
- mediaSettings.StoreInDb = storeIdDb;
-
- //save the new setting value
- await _settingService.SaveSetting(mediaSettings);
-
- //save picture
- await SavePictureStorage(storeIdDb);
-
- //activity log
- _ = _customerActivityService.InsertActivity("EditSettings", "",
- _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),
- _translationService.GetResource("ActivityLog.EditSettings"));
-
- //now clear cache
- await ClearCache();
-
- Success(_translationService.GetResource("Admin.Configuration.Updated"));
- return RedirectToAction("Media");
- }
-
- private async Task SavePictureStorage(bool storeIdDb)
- {
- int pageIndex = 0;
- const int pageSize = 100;
- try
- {
- while (true)
- {
- var pictures = _pictureService.GetPictures(pageIndex, pageSize);
- pageIndex++;
- if (!pictures.Any())
- break;
-
- foreach (var picture in pictures)
- {
- var pictureBinary = await _pictureService.LoadPictureBinary(picture, !storeIdDb);
- if (storeIdDb)
- await _pictureService.DeletePictureOnFileSystem(picture);
- else
- {
- //now on file system
- if (pictureBinary != null)
- await _pictureService.SavePictureInFile(picture.Id, pictureBinary, picture.MimeType);
- }
- picture.PictureBinary = storeIdDb ? pictureBinary : Array.Empty<byte>();
- picture.IsNew = true;
-
- await _pictureService.UpdatePicture(picture);
- }
- }
- }
- finally
- {
- }
-
- }
-
public async Task<IActionResult> Customer()
{
var storeScope = await GetActiveStore();
@@ -949,6 +885,10 @@ namespace Grand.Web.Admin.Controllers
DeleteGuestTaskOlderThanMinutes = settings.DeleteGuestTaskOlderThanMinutes
};
+ //storage settings
+ var storagesettings = _settingService.LoadSetting<StorageSettings>();
+ model.PicturesStoredIntoDatabase = storagesettings.PictureStoreInDb;
+
//area admin settings
var adminsettings = _settingService.LoadSetting<AdminAreaSettings>();
model.DefaultGridPageSize = adminsettings.DefaultGridPageSize;
@@ -1011,6 +951,68 @@ namespace Grand.Web.Admin.Controllers
return await SystemSetting();
}
+
+ [HttpPost]
+ public async Task<IActionResult> ChangePictureStorage()
+ {
+ var storageSettings = _settingService.LoadSetting<StorageSettings>();
+ var storeIdDb = !storageSettings.PictureStoreInDb;
+ storageSettings.PictureStoreInDb = storeIdDb;
+
+ //save the new setting value
+ await _settingService.SaveSetting(storageSettings);
+
+ //save picture
+ await SavePictureStorage(storeIdDb);
+
+ //activity log
+ _ = _customerActivityService.InsertActivity("EditSettings", "",
+ _workContext.CurrentCustomer, HttpContext.Connection?.RemoteIpAddress?.ToString(),
+ _translationService.GetResource("ActivityLog.EditSettings"));
+
+ //now clear cache
+ await ClearCache();
+
+ Success(_translationService.GetResource("Admin.Configuration.Updated"));
+ return RedirectToAction("SystemSetting");
+ }
+
+ private async Task SavePictureStorage(bool storeIdDb)
+ {
+ int pageIndex = 0;
+ const int pageSize = 100;
+ try
+ {
+ while (true)
+ {
+ var pictures = _pictureService.GetPictures(pageIndex, pageSize);
+ pageIndex++;
+ if (!pictures.Any())
+ break;
+
+ foreach (var picture in pictures)
+ {
+ var pictureBinary = await _pictureService.LoadPictureBinary(picture, !storeIdDb);
+ if (storeIdDb)
+ await _pictureService.DeletePictureOnFileSystem(picture);
+ else
+ {
+ //now on file system
+ if (pictureBinary != null)
+ await _pictureService.SavePictureInFile(picture.Id, pictureBinary, picture.MimeType);
+ }
+ picture.PictureBinary = storeIdDb ? pictureBinary : Array.Empty<byte>();
+ picture.IsNew = true;
+
+ await _pictureService.UpdatePicture(picture);
+ }
+ }
+ }
+ finally
+ {
+ }
+
+ }
#endregion
#endregion
diff --git a/src/Web/Grand.Web.Admin/Mapper/MediaSettingsProfile.cs b/src/Web/Grand.Web.Admin/Mapper/MediaSettingsProfile.cs
index 2c8a50a3f..d42d06490 100644
--- a/src/Web/Grand.Web.Admin/Mapper/MediaSettingsProfile.cs
+++ b/src/Web/Grand.Web.Admin/Mapper/MediaSettingsProfile.cs
@@ -10,7 +10,6 @@ namespace Grand.Web.Admin.Mapper
public MediaSettingsProfile()
{
CreateMap<MediaSettings, MediaSettingsModel>()
- .ForMember(dest => dest.PicturesStoredIntoDatabase, mo => mo.Ignore())
.ForMember(dest => dest.ActiveStore, mo => mo.Ignore())
.ForMember(dest => dest.UserFields, mo => mo.Ignore());
CreateMap<MediaSettingsModel, MediaSettings>();
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/MediaSettingsModel.cs b/src/Web/Grand.Web.Admin/Models/Settings/MediaSettingsModel.cs
index e2b513d58..f11f0202e 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/MediaSettingsModel.cs
+++ b/src/Web/Grand.Web.Admin/Models/Settings/MediaSettingsModel.cs
@@ -8,9 +8,6 @@ namespace Grand.Web.Admin.Models.Settings
#region Standard Media Settings
public string ActiveStore { get; set; }
- [GrandResourceDisplayName("Admin.Settings.Media.PicturesStoredIntoDatabase")]
- public bool PicturesStoredIntoDatabase { get; set; }
-
[GrandResourceDisplayName("Admin.Settings.Media.ProductThumbPictureSize")]
public int ProductThumbPictureSize { get; set; }
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/SystemSettingsModel.cs b/src/Web/Grand.Web.Admin/Models/Settings/SystemSettingsModel.cs
index 54830b9c1..38fb8f9d9 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/SystemSettingsModel.cs
+++ b/src/Web/Grand.Web.Admin/Models/Settings/SystemSettingsModel.cs
@@ -34,6 +34,13 @@ namespace Grand.Web.Admin.Models.Settings
#endregion
+ #region StorageSettings
+
+ [GrandResourceDisplayName("Admin.Settings.Media.PicturesStoredIntoDatabase")]
+ public bool PicturesStoredIntoDatabase { get; set; }
+
+ #endregion
+
#region Language settings
[GrandResourceDisplayName("Admin.Settings.System.DefaultAdminLanguageId")]