Skip to content

Commit b1f535a

Browse files
committed
Fixes export profile never updated. MiniMapper too dangerous here:
DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. InvalidOperationException: The relationship could not be changed because one or more of the foreign-key properties is non-nullable.
1 parent 4e61648 commit b1f535a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Presentation/SmartStore.Web/Administration/Controllers/ExportController.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,12 +755,19 @@ public ActionResult Edit(ExportProfileModel model, bool continueEditing)
755755
return View(model);
756756
}
757757

758-
MiniMapper.Map(profile, model);
759-
758+
profile.Name = model.Name;
759+
profile.FileNamePattern = model.FileNamePattern;
760+
profile.FolderName = model.FolderName;
761+
profile.Enabled = model.Enabled;
762+
profile.ExportRelatedData = model.ExportRelatedData;
763+
profile.Offset = model.Offset;
760764
profile.Limit = model.Limit ?? 0;
761765
profile.BatchSize = model.BatchSize ?? 0;
766+
profile.PerStore = model.PerStore;
762767
profile.CompletedEmailAddresses = string.Join(",", model.CompletedEmailAddresses ?? new string[0]);
763768
profile.EmailAccountId = model.EmailAccountId ?? 0;
769+
profile.CreateZipArchive = model.CreateZipArchive;
770+
profile.Cleanup = model.Cleanup;
764771

765772
if (profile.Name.IsEmpty())
766773
profile.Name = provider.Metadata.FriendlyName;
@@ -779,6 +786,7 @@ public ActionResult Edit(ExportProfileModel model, bool continueEditing)
779786
projection.AppendDescriptionText = string.Join(",", model.Projection.AppendDescriptionText ?? new string[0]);
780787
projection.RemoveCriticalCharacters = model.Projection.RemoveCriticalCharacters;
781788
projection.CriticalCharacters = string.Join(",", model.Projection.CriticalCharacters ?? new string[0]);
789+
782790
profile.Projection = XmlHelper.Serialize(projection);
783791
}
784792

@@ -791,6 +799,7 @@ public ActionResult Edit(ExportProfileModel model, bool continueEditing)
791799

792800
filter.StoreId = model.Filter.StoreId ?? 0;
793801
filter.CategoryIds = model.Filter.CategoryIds?.Where(x => x != 0)?.ToArray() ?? new int[0];
802+
794803
profile.Filtering = XmlHelper.Serialize(filter);
795804
}
796805

src/Presentation/SmartStore.Web/Administration/Views/Export/Edit.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<fieldset>
1212
@Html.AntiForgeryToken()
1313
@Html.HiddenFor(model => model.Id)
14+
@Html.HiddenFor(model => model.ProviderSystemName)
1415

1516
<div class="section-header">
1617
<div class="title">

0 commit comments

Comments
 (0)