v3.0.0 #4030
Replies: 3 comments 5 replies
-
Spree::Image customizationError:
Cause
# config/initializers/spree.rb`
config.image_attachment_module = 'Spree::Image::PaperclipAttachment'
config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment' Take care you don't have any customization of Solution To fix, move the customization to a decorator, for example, if you have: # config/intitializers/something.rb
Spree::Image.attachment_definitions[:attachment][:styles] = {
mini: '48x48>',
small: '100x100>',
product: '240x240>',
large: '600x600>'
} Move it into: # app/models/spree/image_decorator.rb
# frozen_string_literal: true
module Spree
module ImageDecorator
class << self
private
def prepended(klass)
klass.attachment_definitions[:attachment][:styles] = {
mini: '48x48>',
small: '100x100>',
product: '240x240>',
large: '600x600>'
}
end
end
Spree::Image.prepend self
end
end |
Beta Was this translation helpful? Give feedback.
-
ActionCable JS inclusionError
Cause We are not requiring the whole Solution Depending on if you are using ActionCable or not, you may want to manually |
Beta Was this translation helpful? Give feedback.
-
Hi, I just upgraded from 3.0.0.rc2 to 3.0.0 and now when I start my server I'm getting the following logs (fresh install, no specific graphql changes):
Apart from these weird logs, app is running and working well, does anyone have an idea what is causing this ? Thanks ! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🎉 Solidus 3.0 is out!
This version is almost identical to the last 2.11.x version with the only difference that we removed all the code deprecated. Here's a list of things to take into account while upgrading.
Major Changes
Removal of all code deprecated during the 2.x series
The main change in this major version is the removal of all deprecated code that
we introduced during the 2.x series. This means that if any code that was deprecated
is still being used, the application will break. Following the deprecation messages
in the application logs, it should be quite easy to spot what code needs to be changed.
The main things that could break a Solidus application are:
Paranoia gem has been replaced by Discard gem
All references to methods added to models by Paranoia will raise a NoMethodError exception now.
Some of those methods are:
paranoia_destroy
paranoia_delete
with_deleted
only_deleted
really_destroy!
after_real_destroy
Pull Requests:
Removed core support to first_name and last_name in Spree::Address
In Solidus v2.11, we added a
name
attribute toSpree::Address
, which is being populated combiningfirst_name
andlast_name
values every time a new address is added to the system. We also provideda rake task to update all existing records in order to get applications ready for Solidus 3.0.
With this major version,
name
is the only supported attributes.first_name
andlast_name
fields are already in the databaseso if needed, a store can revert this change by implementing its own logic.
See 3234 for the rationale behind this change.
Pull Requests:
All the other deprecations removal
For a complete reference to rest of the code removed, these PRs can be taken as reference:
Removal without deprecations
We also removed some code that didn't need a deprecation warning. Be sure that your
codebase doesn't use any of the following:
Spree::LineItem::CurrencyMismatch
exception: we are not using it anymore since the behavior we had withSpree::Config.raise_with_invalid_currency = true
has been removed.Spree::Order::Checkout
is not used anymore.Spree::Core::StateMachines::Order
is identical.Spree::Admin::PaymentsHelper
module is empty after removing all deprecated methods inside it.UserPaymentSource
is empty after removing all deprecated methods inside it.Spree::Refund#perform_after_create
attribute, it was into a deprecated path. If you are still using it, please stop, it does nothing now.Spree::TaxCalculator#ShippingRate
: it is alwaysnil
now.Spree::Money::RUBY_NUMERIC_STRING
: was only used in a deprecated code path.We also removed the following preferences without deprecations. They were just controlling a deprecated
flow and have no effect so, assuming you already switched to the only accepted value, you can safely
remove them from your initializer. You'll probably notice that because your app won't start.
Spree::Config.raise_with_invalid_currency
Spree::Config.redirect_back_on_unauthorized preference
Spree::Config.run_order_validations_on_order_updater preference
Spree::Config.use_legacy_order_state_machine
Spree::Config.use_legacy_store_credit_reimbursement_category_name
Spree::Config.consider_actionless_promotion_active
Spree::Config.use_legacy_address_state_validator
Spree::Config.use_combined_first_and_last_name_in_address
By default, do not require the whole Rails framework
This shouldn't give any issue in host applications, but if that happens,
it can be easily fixable opening
config/application.rb
and addrequire 'rails/all'
orthe specific part of Rails needed by the application.
Switch Paperclip dependency to its maintained version
We recently added support for Active Support, which will be the default in Solidus 3.0.
Paperclip will still be around and supported for a while because we don't want to force
existing stores to accomplish the assets migration. While we support it, we want to use
the maintained fork.
Misc
github.com/kennyadsl))
This discussion was created from the release v3.0.0.
Suggested Upgrade Path
v2.11
(as of today, it is2.11.9
).bin/rails railties:install:migrations
andbin/rails db:migrate
.bin/rails solidus:upgrade:two_point_eleven
.gem 'solidus', '~> 3.0.0'
, runbundle install
.Common problems
👇 I'll leave some common errors in the comments below with the solution. Feel free to comment here if you encounter any problem upgrading.
Beta Was this translation helpful? Give feedback.
All reactions