-
Notifications
You must be signed in to change notification settings - Fork 476
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 .current
method back to ShopifyAPI::Shop and ShopifyAPI::RecurringApplicationCharge
#923
Comments
We're adding this to the TODO list! Keeping this issue open to let others also chime in their feedback |
@mllemango this is a breaking change was not mentioned in docs. It has been widely used so please add it back. |
Do there is any similar method that it has been replaced with ? |
+1, this was the last hurdle that prevented us from upgrading version :( |
+1 from me as well. |
+1 from me as well |
I, also, do not see any mention of this breaking change in the changelog. Will the changelog be updated? Until this method is restored, what is the workaround? |
This works: |
@axlekb @mllemango - does this workaround really work reliably? It isnt very descriptive. At first glance it could just get the first shop that has this app or something. Like the others above, I used the |
I'm using that instead, waiting for upgrase. xo
|
|
Sometimes I think the dev team in Shopify has no idea what they are doing. Instead of improving, things became harder to handle. Current app version is v21 but you still have to write tons of custom code to handle payments, trial/ decline payments etc |
Does this really work? |
The old method was very convenient. Not sure what was the motivation for removing it during the rewrite. For now, I added this to my Rails initializer to restore old behavior: # config/initializers/shopify_app.rb
Rails.application.config.after_initialize do
class ShopifyAPI::Shop
def self.current(session: ShopifyAPI::Context.active_session, fields: nil)
ShopifyAPI::Shop.all(session: session, fields: fields).first
end
end
end |
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days. |
Any updates on this? |
This is still a major missing feature that we're all having to add to our codebases. When this library was rewritten, the V10 changelog says this:
This issue is glaring proof that "all essential features" are not yet provided. This version should have stayed a "beta" release or something like it until a minimum amount of feature parity was in place. The "upgrade" of this gem in order to meet with Shopify's required changes feels like it has been done with very little consideration of the users of this library. In short, here's my 👍 for adding this (and so many similar) convenience features back to this library so I an get rid of all these monkey patches I'm adding in the gem initializer. |
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days. |
Any updates on this? |
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days. |
Not stale |
To put it bluntly - developing for shopify is literally the worst. Changelogs suck. Usage docs suck. Upgrades suck. I'm still stuck at <V10 because there were so many breaking changes from 9 to 10 that my entire custom app would need a rewrite and I have a hard time explaining that to my client. |
I'm currently using this approach: client = ShopifyAPI::Clients::Rest::Admin.new(session: @session)
client.get(path: 'shop') |
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days. |
Not stale. |
Wow, so long and nothing! |
annoying |
I'm using the latest api version. |
Hey folks, sorry it took us so long to address this, and thank you for your patience. I've just put up a PR that adds back those utilities, it'll be included in the next release. |
Issue summary
With the new breaking api change,
ShopifyAPI::Shop.current
,ShopifyAPI::RecurringApplicationCharge.current
methods are missing. Is there any plan in adding these back?Expected behavior
ShopifyAPI::Shop.current
should return the current shop from the session.Actual behavior
Right now it returns
NoMethodError: undefined method 'current' for ShopifyAPI::Shop:Class
Previous implementation
Steps to reproduce the problem
Specifications
shopify_api
version: 10.0.02022-04
): 2022-04The text was updated successfully, but these errors were encountered: