-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
bugDescribes or fixes a bug.Describes or fixes a bug.
Description
When starting Solidus with the solidus_subscriptions
gem, we get a deprecation warning:
DEPRECATION WARNING: Passing sections to Spree::BackendConfiguration::MenuItem is deprecated. Please pass a label instead. (called from new at /home/erwin/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/bundler/gems/solidus_subscriptions-1149f416b1be/lib/solidus_subscriptions/engine.rb:43)
DEPRECATION WARNING: Passing icon to Spree::BackendConfiguration::MenuItem is deprecated. Please use the keyword argument instead. (called from new at /home/erwin/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/bundler/gems/solidus_subscriptions-1149f416b1be/lib/solidus_subscriptions/engine.rb:43)
Looks like this comes from:
config.menu_items << config.class::MenuItem.new( |
Per the Solidus documentation, seems the format has changed to:
https://guides.solidus.io/customization/customizing-the-backend#adding-new-menu-items
# ...
config.menu_items << config.class::MenuItem.new(
label: :rejected_orders,
icon: 'ban',
url: '/admin/orders?q[rejected_eq]=true' )
Solidus Version:
4.2.3
Additional context
Not a major issue. Just would be a better experience for new developers and existing developers to update this and clear the warning on rails server startup.
Fix
I think if you just change the structure to the following, it should work and clear the deprecation notice:
config.menu_items << config.class::MenuItem.new(
label: :subscriptions,
icon: 'repeat',
url: :admin_subscriptions_path,
condition: ->{ can?(:admin, SolidusSubscriptions::Subscription) },
match_path: '/subscriptions'
)
Metadata
Metadata
Assignees
Labels
bugDescribes or fixes a bug.Describes or fixes a bug.