Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Deprecate legacy modules targeting Spree 5.5 (#13611)
Damian Legawiec798754262146
diff --git a/backend/engines/core/lib/spree/core/controller_helpers/common.rb b/backend/engines/core/lib/spree/core/controller_helpers/common.rbindex ae0647dd4a..5ea64a94c4 100644--- a/backend/engines/core/lib/spree/core/controller_helpers/common.rb+++ b/backend/engines/core/lib/spree/core/controller_helpers/common.rb@@ -1,7 +1,13 @@module Spreemodule Coremodule ControllerHelpers+ # @deprecated This module is deprecated and will be removed in Spree 5.5.module Common+ def self.included(base)+ Spree::Deprecation.warn(+ 'Spree::Core::ControllerHelpers::Common is deprecated and will be removed in Spree 5.5.'+ )+ endendendenddiff --git a/backend/engines/core/lib/spree/core/product_filters.rb b/backend/engines/core/lib/spree/core/product_filters.rbindex 2799b4004e..2f7ca85748 100644--- a/backend/engines/core/lib/spree/core/product_filters.rb+++ b/backend/engines/core/lib/spree/core/product_filters.rb@@ -42,7 +42,16 @@ module Spree# or taxons), eg see the taxon model/controller.# See specific filters below for concrete examples.+ # @deprecated This module is deprecated and will be removed in Spree 5.5.+ # Use Spree::Api::V3::FiltersAggregator instead.module ProductFilters+ def self.deprecated_warning+ Spree::Deprecation.warn(+ 'Spree::Core::ProductFilters is deprecated and will be removed in Spree 5.5. ' \+ 'Please use Spree::Api::V3::FiltersAggregator instead.'+ )+ end+# Example: filtering by price# The named scope just maps incoming labels onto their conditions, and builds the conjunction# 'price' is in the base scope's context (ie, "select foo from products where ...") so@@ -66,6 +75,7 @@ module Spreeenddef self.price_filter+ deprecated_warningv = Spree::Price.arel_tableconds = [[Spree.t(:under_price, price: format_price(10)), v[:amount].lteq(10)],["#{format_price(10)} - #{format_price(15)}", v[:amount].between(10..15)],@@ -107,6 +117,7 @@ module Spreeenddef self.brand_filter+ deprecated_warningbrand_property = Spree::Property.find_by(name: 'brand')brands = brand_property ? Spree::ProductProperty.where(property_id: brand_property.id).pluck(:value).uniq.map(&:to_s) : []@@ -148,6 +159,7 @@ module Spreeenddef self.selective_brand_filter(taxon = nil)+ deprecated_warningtaxon ||= Spree::Taxonomy.first.rootbrand_property = Spree::Property.find_by(name: 'brand')scope = Spree::ProductProperty.where(property: brand_property).@@ -174,6 +186,7 @@ module Spree# This scope selects products in any of the active taxons or their children.#def self.taxons_below(taxon)+ deprecated_warningreturn Spree::Core::ProductFilters.all_taxons if taxon.nil?{@@ -191,6 +204,7 @@ module Spree## idea: expand the format to allow nesting of labels?def self.all_taxons+ deprecated_warningtaxons = Spree::Taxonomy.all.map { |t| [t.root] + t.root.descendants }.flatten{name: 'All taxons',diff --git a/backend/engines/core/lib/spree/core/query_filters/comparable.rb b/backend/engines/core/lib/spree/core/query_filters/comparable.rbindex 887ceb28ac..9cb49b8a1e 100644--- a/backend/engines/core/lib/spree/core/query_filters/comparable.rb+++ b/backend/engines/core/lib/spree/core/query_filters/comparable.rb@@ -1,8 +1,12 @@module Spreemodule Coremodule QueryFilters+ # @deprecated This class is deprecated and will be removed in Spree 5.5.class Comparabledef initialize(attribute:)+ Spree::Deprecation.warn(+ "#{self.class.name} is deprecated and will be removed in Spree 5.5."+ )@attribute = attributeenddiff --git a/backend/engines/core/lib/spree/core/query_filters/text.rb b/backend/engines/core/lib/spree/core/query_filters/text.rbindex e55727a91a..8489183146 100644--- a/backend/engines/core/lib/spree/core/query_filters/text.rb+++ b/backend/engines/core/lib/spree/core/query_filters/text.rb@@ -1,8 +1,12 @@module Spreemodule Coremodule QueryFilters+ # @deprecated This class is deprecated and will be removed in Spree 5.5.class Textdef initialize(attribute:)+ Spree::Deprecation.warn(+ 'Spree::Core::QueryFilters::Text is deprecated and will be removed in Spree 5.5.'+ )@attribute = attributeend