Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Solidus Alchemy menu items in initializer #98

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Oct 25, 2023

This adds the menu items for Alchemy in an after_initialize hook rather than modifying the spree.rb initializer. The advantage here is that we can support both the new MenuItem API from Solidus 4.2+ as well as the old one. For people who have either not wrapped their in-app initializer in a config.after_initialize hook, we will also add a nice deprecation warning if they already have the Alchemy menu item in the list of menu items. For people who have wrapped their backend configuration in after_initialize, there is no hook we can hook into after that. They will see a double menu entry, and figure out to delete their own.

mamhoff and others added 2 commits October 25, 2023 14:50
This adds the menu items for Alchemy in an `after_initialize` hook
rather than modifying the `spree.rb` initializer. The advantage here is
that we can support both the new MenuItem API from Solidus 4.2+ as well
as the old one. For people who have either not wrapped their in-app
initializer in a `config.after_initialize` hook, we will also add a nice
deprecation warning if they already have the Alchemy menu item in the
list of menu items. For people who have wrapped their backend
configuration in `after_initialize`, there is no hook we can hook into
after that. They will see a double menu entry, and figure out to delete
their own.
In order to prevent ordering issues we simply
do that in normal init flow.
@tvdeyen tvdeyen merged commit 19db089 into AlchemyCMS:main Oct 25, 2023
@tvdeyen
Copy link
Member

tvdeyen commented Oct 25, 2023

Thanks 🍰

@mamhoff mamhoff deleted the solidus-4.2-menu-items branch October 25, 2023 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants