AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
Delete image from image gallery throws an error 9.0.6
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
To reproduce, click to upload an image to the image gallery section. The image then shows and if you check the store page, it shows there also. Oops, wrong image, try to delete it. An error is thrown each time you try, but after numerous attempts, it finally does delete. Error is: An error has occured at http://localhost/Able9B7222Test3/Admin/Product/DeleteProductGalleryImages USER ID: 30403 IP: ::1 View less Exception: Value cannot be null. Parameter name: source Stack Trace: at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector) at AbleCommerce.Areas.Admin.Controllers.ProductController.DeleteProductGalleryImages(List`1 imageIds, Int32 productId) in E:\Able9B7222Test3\Website\Areas\Admin\Controllers\ProductController.cs:line 1817 at Debugging - public ActionResult DeleteProductGalleryImages(List<string> imageIds, int productId) { List<int> imagesIntIds = imageIds.Select(m => AlwaysConvert.ToInt(m)).ToList(); Note- this is the delete from the garbage can icon. If you go into Advanced Settings and click the Delete button, you can delete it. Edited by user Thursday, September 22, 2022 12:19:22 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
This is an area that really needs to be completely redone, I am aware of this particular situation. This is why I don't even mess with the built-in system. Since I have access to the server, I delete pics using Windows explorer. Also trying to find what you're looking for, it's a pain, but I don't need to tell you that.
-Ray
|
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
I have confirmed the issue and registered as a bug. For now, you can try the following fix: Open /Admin/Views/Product/ProductImage.cshtml file Locate the following line Code:
imageIds = $("select").val();
and update with (to delete a single image from gallery) Code:imageIds = $("select option").val();
OR use the below code to delete multiple images at once Code:$("select option").each(function () {
imageIds.push($(this).val());
});
Edited by user Thursday, September 22, 2022 1:48:04 PM(UTC)
| Reason: Not specified
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
Delete image from image gallery throws an error 9.0.6
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