When editing the goods, the tags of the goods are deleted (disappear)

Thursday, April 25, 2024 12:17:11 PM
  • Posted: Sunday, June 17, 2018 6:17 AM
  • 2
If the goods are first assigned tags, they are saved, but if the product is edited, then the tags are deleted when saving. You open once again for editing the goods, and there in the field "Tags (keywords)": "Enter tags ..."
Reason: error in the code.
File: \Grand.Web\Areas\Admin\Controllers\ProductController.cs
Metod:
protected virtual void SaveProductTags(Product product, string[] productTags)

Line:
if (existingProductTag.Equals(newProductTag, StringComparison.OrdinalIgnoreCase))

This line compares the IDs of the tags associated with the product with the tag names derived from the item edit form.

1
  • Posted: Sunday, June 17, 2018 6:23 AM
  • 2
Troubleshooting

In the cycle: foreach (var existingProductTag in existingProductTags)
add

string existingProductTagName = _productTagService.GetProductTagById(existingProductTag).Name;


In the cycle: foreach (string newProductTag in productTags)
correct


//if (existingProductTag.Equals(newProductTag, StringComparison.OrdinalIgnoreCase))
if (existingProductTagName.Equals(newProductTag, StringComparison.OrdinalIgnoreCase))

1
  • Posted: Sunday, June 17, 2018 11:58 AM
  • 953
Hello Victor,

Thanks for reporting. It's already fixed in the newest version, 4.20. It will be released in June/July, I guess.

Best,
Patryk
Best regards,
Patryk

GrandNode Team
0
back to top
Filters