logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Thursday, September 22, 2022 12:05:17 PM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 229

Thanks: 19 times
Was thanked: 3 time(s) in 3 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

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

ray22901031  
#2 Posted : Thursday, September 22, 2022 12:19:59 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 659

Thanks: 2 times
Was thanked: 9 time(s) in 9 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
nadeem  
#3 Posted : Thursday, September 22, 2022 1:34:21 PM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 70

Thanks: 8 times
Was thanked: 8 time(s) in 8 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

Users browsing this topic
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.