title | section | order | description |
---|---|---|---|
Upgrading Spree 4.1 to 4.2 |
upgrades |
0 |
This guide covers upgrading a 4.1 Spree application to Spree 4.2. |
If you have any questions or suggestions feel free to reach out through Spree slack channels
If you're on an older version than 4.1 please follow previous upgrade guides and perform those upgrades incrementally, eg.
This is the safest and recommended method.
gem 'spree', '~> 4.2'
gem 'spree_auth_devise', '~> 4.3'
gem 'spree_gateway', '~> 3.9'
gem 'spree_i18n', '~> 5.0'
If you used that gem in the past you need to remove it. Multi-Currency is now incorporated into Spree core and you cannot use that gem anymore.
- Remove
spree_multi_currency
from yourGemfile
- Remove these preferences from your Spree initializer (
config/initializers/spree.rb
):allow_currency_change
show_currency_selector
supported_currencies
- Remove
//= require spree/frontend/spree_multi_currency
fromvendor/assets/javascripts/spree/frontend/all.js
- Remove
//= require spree/backend/spree_multi_currency
fromvendor/assets/javascripts/spree/backend/all.js
All international configuration is now kept on the Store
model in the database rather than in initializer files.
If you used spree_i18n
gem before please remove any SpreeI18n::Config
references from your config/initializers/spree.rb
file.
If you used Deface overrides you will need to include deface
in your Gemfile
as it was removed from Spree / Spree Auth Devise / Spree Gateway dependencies.
Simply add it to your Gemfile
:
gem 'deface'
bundle update
Please find a add_stock_location_to_rma
migration in your db/migrate
directory and change:
class AddStockLocationToRma < ActiveRecord::Migration[4.2]
to
class AddStockLocationToRMA < ActiveRecord::Migration[4.2]
rails spree:install:migrations
rails active_storage:update
rails db:migrate
To avoid errors and compatibility issues, please update all of your Spree extension gems to the newest versions which usually includes fixes for the new Spree release, eg.
bundle update spree_related_products
Please follow this guide to migrate your custom serializers.
Only if you've added new Admin Panel pages with Select2 dropdown - this guide will help
If you're using Spree default Storefront (spree_frontend
gem) make sure to update your templates, especially:
- app/views/spree/shared/_head.html.erb
- app/views/spree/shared/_locale_and_currency.html.erb
- app/views/spree/shared/_link_to_account.html.erb
- app/views/spree/shared/_internationalization_options.html.erb
- app/views/spree/shared/_locale_dropdown.html.erb
- app/views/spree/shared/_currency_dropdown.html.erb
- app/views/spree/shared/_mobile_navigation.html.erb
- app/views/spree/shared/_mobile_internationalization_options.html.erb
- app/views/spree/shared/_nav_bar.html.erb
- app/views/spree/shared/_line_item.html.erb
Or simply run bundle exec rails g spree:frontend:copy_storefront
For information about changes contained within this release, please read the 4.2.0 Release Notes.
If you have any questions or suggestions feel free to reach out through Spree slack channels