AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
9.0.4 Bug in Edit Product->Images->Advanced Settings
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
If the product has an ac_ProductImages record with an empty ImageUrl value, clicking the Advanced Settings button throws an exception. The calls in the Width, Height properties don't like getting passed an empty value. Code:
productImageModel.ImagesModelList = product.Images.Select(m => new ProductImageModel.ImageModel() {
Id = m.Id,
Url = m.ImageUrl,
Alt = m.ImageAltText,
Label = m.Moniker,
Width = System.Drawing.Image.FromFile(Server.MapPath(m.ImageUrl)).Width.ToString(),
Height = System.Drawing.Image.FromFile(Server.MapPath(m.ImageUrl)).Height.ToString()
}).ToList();
Seems to work ok if there's a value and the image file no longer exists. Edited by user Sunday, September 5, 2021 6:20:29 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
I am reporting this as a bug. Thanks
Although it is highly unlikely that ImageUrl field will become empty in normal scenarios.
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
9.0.4 Bug in Edit Product->Images->Advanced Settings
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close