You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem concerning re-assigning images to another variant of the same product. Didn't have this problem in older versions of Solidus (but don't know when it came about).
Solidus Version:
2.11.0.alpha
To Reproduce
Go to /admin/products/my-product/images for a product with multiple variants and multiple images,
Re-assign an image from one variant to another
Press the "Save" icon
Current behavior
The update fails and the "The resource you were looking for could not be found" flash message is displayed. The image is not re-assigned.
Expected behavior
The update succeeds, the success flash message is displayed, and the image is re-assigned to the selected variant.
Desktop:
OS: Ubuntu 20.04
Browser: Firefox - Version [e.g. 22]
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser: Firefox 81.0
Additional context
The view for the images tab loads images using @product.gallery.images which will get all images from all of the product's variants (has_many :variant_images, -> { order(:position) }, source: :images, through: :variants_including_master).
But Spree::Api::ImagesController#update only tries to select the image for update with
I have a problem concerning re-assigning images to another variant of the same product. Didn't have this problem in older versions of Solidus (but don't know when it came about).
Solidus Version:
2.11.0.alpha
To Reproduce
/admin/products/my-product/images
for a product with multiple variants and multiple images,Current behavior
The update fails and the "The resource you were looking for could not be found" flash message is displayed. The image is not re-assigned.
Expected behavior
The update succeeds, the success flash message is displayed, and the image is re-assigned to the selected variant.
Desktop:
Smartphone (please complete the following information):
Additional context
The view for the images tab loads images using
@product.gallery.images
which will get all images from all of the product's variants (has_many :variant_images, -> { order(:position) }, source: :images, through: :variants_including_master)
.But
Spree::Api::ImagesController#update
only tries to select the image for update with@image = scope.images.accessible_by(current_ability, :update).find(params[:id])
where
scope
is aSpree::Product
- in other words, images assigned to variants will not be found.The text was updated successfully, but these errors were encountered: