{"record":{"id":"5daf640ef12bd17d","repo":"spree/spree","slug":"spree-taxons-addproducts-is-deprecated-and-will","errorCode":null,"errorMessage":"Spree::Taxons::AddProducts is deprecated and will be removed in Spree 6.1. Use Spree::Categories::AddProducts instead.","messagePattern":"Spree::Taxons::AddProducts is deprecated and will be removed in Spree 6\\.1\\. Use Spree::Categories::AddProducts instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"spree/core/app/services/spree/taxons/add_products.rb","lineNumber":13,"sourceCode":"module Spree\n  module Taxons\n    # @deprecated Renamed to Spree::Categories::AddProducts in 6.0. This shim keeps\n    #   the old `taxons:` keyword working by delegating to the renamed service;\n    #   removed in 6.1.\n    class AddProducts\n      prepend Spree::ServiceModule::Base\n\n      # @param taxons [Array<Spree::Category>]\n      # @param products [Array<Spree::Product>]\n      # @return [Spree::ServiceModule::Base::Result]\n      def call(taxons:, products:)\n        Spree::Deprecation.warn('Spree::Taxons::AddProducts is deprecated and will be removed in Spree 6.1. Use Spree::Categories::AddProducts instead.')\n        Spree::Categories::AddProducts.call(categories: taxons, products: products)\n      end\n    end\n  end\nend\n","sourceCodeStart":1,"sourceCodeEnd":19,"githubUrl":"https://github.com/spree/spree/blob/06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2/spree/core/app/services/spree/taxons/add_products.rb#L1-L19","documentation":"The 6.0 taxon→category rename: Spree::Taxons::AddProducts is a deprecated shim that warns and delegates to Spree::Categories::AddProducts.call(categories:, products:), which bulk-inserts product-category join rows with incremental positions. The old taxons: keyword keeps working through the shim; removed in 6.1.","triggerScenarios":"Spree::Taxons::AddProducts.call(taxons: [taxon], products: products) — admin bulk-categorization actions, imports and seeds written against the pre-6.0 namespace.","commonSituations":"Catalog tooling upgraded to 6.0; CSV import pipelines assigning products to taxons; extensions managing category membership.","solutions":["Call Spree::Categories::AddProducts.call(categories: [category], products: products) — same bulk behavior and positions.","Rename surrounding taxon vocabulary to category (Spree::Taxon is an alias for Spree::Category in 6.0) so the code reads consistently.","Sweep for 'Taxons::' service references — AutoMatchTaxons (error 233) and RegenerateProducts (error 239) belong to the same family.","Confirm with deprecations raised that no shim is still exercised."],"exampleFix":"# before\nSpree::Taxons::AddProducts.call(taxons: [taxon], products: [product])\n\n# after\nSpree::Categories::AddProducts.call(categories: [category], products: [product])","handlingStrategy":"validation","validationCode":"if defined?(Spree::Categories::AddProducts)\n  Spree::Categories::AddProducts.call(categories: [taxon], products: products)\nelse\n  Spree::Taxons::AddProducts.call(taxons: [taxon], products: products)\nend","typeGuard":"# @return [Boolean] true when the category-named bulk adder exists\ndef spree_categories_add_products?\n  defined?(Spree::Categories::AddProducts)\nend","tryCatchPattern":null,"preventionTips":["Adopt the Category/Collection vocabulary in your own class and variable names during 6.0 work — shim warnings are the reminder.","Spec bulk assignment through the public result (join rows + positions), not through which service constant ran.","Sweep imports/seeds for 'Taxons::' references when upgrading; they are the usual legacy holdouts."],"tags":["deprecation","spree","categories","taxons","rename"],"backgroundTag":"deprecated-api-rename","analyzedSha":"06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2","analyzedAt":"2026-08-21T14:59:48.125Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}