Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Toxantron committed Jul 24, 2022
2 parents 5427e89 + 44d44aa commit 0cd5461
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.12.2
5.13.1
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,14 @@ public IProductType ConvertProductBack(ProductModel source, ProductType converte
_productManagement.SaveRecipe(recipe);

// Delete recipes
var recipesOfProduct = _productManagement.GetRecipes(converted, RecipeClassification.CloneFilter);
foreach (var recipe in recipesOfProduct)
if (recipes.FirstOrDefault(r => r.Id == recipe.Id) == null)
_productManagement.RemoveRecipe(recipe.Id);

if(converted.Id != 0)
{
var recipesOfProduct = _productManagement.GetRecipes(converted, RecipeClassification.CloneFilter);
foreach (var recipe in recipesOfProduct)
if (recipes.FirstOrDefault(r => r.Id == recipe.Id) == null)
_productManagement.RemoveRecipe(recipe.Id);
}

// Product is flat
if (source.Properties is null)
return converted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ public IReadOnlyList<IProductRecipe> GetRecipes(IProductType productType, Recipe
{
ValidateHealthState();
var recipes = RecipeManagement.GetRecipes(productType, classification);
if (recipes == null)
return null;
return recipes.Select(ReplaceOrigin).ToArray();
}

Expand Down

0 comments on commit 0cd5461

Please sign in to comment.