Skip to content
This repository was archived by the owner on Aug 13, 2021. It is now read-only.
This repository was archived by the owner on Aug 13, 2021. It is now read-only.

product options / taxons not updated if more than 1 #148

Description

@blset

Hello

In the backoffice, with lastest spree-0b99e882892b 3.1
and spree-multi-domain-5017b56aee41

a product is not updated correctly from the back office if more than one entry in the taxons or options field

after some research, it looks like Spree::Admin::ProductsController#update is never visited,
because of the decorator products_controller_decorator.rb


  def update
    store_ids = params[:product][:store_ids]
    if store_ids.present?
      params[:product][:store_ids] = store_ids.split(',')
    end
    super
  end

in fact the super calls Spree::Admin::ResourcesController (because of super) and not
Spree::Admin::ProductsController#update

for that reason the necessary code below is never visited

if params[:product][:taxon_ids].present?
          params[:product][:taxon_ids] = params[:product][:taxon_ids].split(',')
        end
        if params[:product][:option_type_ids].present?
          params[:product][:option_type_ids] = params[:product][:option_type_ids].split(',')
        end

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions