Delete product tags issue on 4.40
Monday, November 25, 2024 2:24:23 PM
Thank you for bug report. Here is work item.
Best regards,
Tomasz
GrandNode Team
Tomasz
GrandNode Team
0
0
Deleting a product tag for a product is throwing a null reference exception if a tag contains uppercase letters.
System.NullReferenceException: Object reference not set to an instance of an object.
at Grand.Web.Areas.Admin.Services.ProductViewModelService.SaveProductTags(Product product, String[] productTags) in C:\dev\Grand.Web\Areas\Admin\Services\ProductViewModelService.cs:line 192
Also, adds lowercase tags to product record, essentially duplicating tags.
System.NullReferenceException: Object reference not set to an instance of an object.
at Grand.Web.Areas.Admin.Services.ProductViewModelService.SaveProductTags(Product product, String[] productTags) in C:\dev\Grand.Web\Areas\Admin\Services\ProductViewModelService.cs:line 192
Also, adds lowercase tags to product record, essentially duplicating tags.
0
We started with a new 4.40 database. We wrote a custom product import process to load our products, product tags, and categories. We use the following code to create new product tags:
Looks like we have to force our tags to lowercase before inserting. Should the lowercase constraint be enforced at the service level inside of _productTagService.InsertProductTag(productTag)?
var productTag = _productTagService.GetProductTagByName(tagName);
if (productTag == null)
{
//add new product tag
productTag = new ProductTag
{
Name = tagName,
Count = 0,
};
_productTagService.InsertProductTag(productTag);
}
Looks like we have to force our tags to lowercase before inserting. Should the lowercase constraint be enforced at the service level inside of _productTagService.InsertProductTag(productTag)?
0
Yes, you need change to lowercase. When user adding tags in admin panel - it always change name to lowercase.
We will add change to lowercase in service. Thanks for suggestions.
In the application there are more such changes about lowercase.
For example: Email in Customer, Coupon Code, Gift Card.
This is due to better performance MongoDB, but for end user it doesn't matter.
Best Regards
Krzysztof
We will add change to lowercase in service. Thanks for suggestions.
In the application there are more such changes about lowercase.
For example: Email in Customer, Coupon Code, Gift Card.
This is due to better performance MongoDB, but for end user it doesn't matter.
Best Regards
Krzysztof
0