-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
ActionView::Template::Error in spree/admin/payments#new #2655
Comments
An enterprise in Australia can't create payments via the admin interface. The above error is raised when visiting https://openfoodnetwork.org.au/admin/orders/R513858701/payments/new. Somehow it seems possible that This doesn't affect all enterprises. We haven't found out yet which circumstances trigger this. |
My investigation so far: The root cause is that the
Bonus points:
The quick fix is: diff --git a/app/views/spree/admin/payments/_form.html.erb b/app/views/spree/admin/payments/_form.html.erb
index e46b2febc..e075d1288 100644
--- a/app/views/spree/admin/payments/_form.html.erb
+++ b/app/views/spree/admin/payments/_form.html.erb
@@ -1,5 +1,5 @@
<%= admin_inject_json "admin.payments", "currentOrderNumber", @order.number %>
-<%= admin_inject_json_ams_array "admin.payments", "paymentMethods", @payment_methods, Api::PaymentMethodSerializer %>
+<%= admin_inject_json_ams_array "admin.payments", "paymentMethods", @payment_methods, Api::PaymentMethodSerializer, current_order: @order %>
<div data-hook="admin_payment_form_fields" class="row">
<div class="alpha three columns"> |
8c6b8d5 is the first bad commit for this particular bug. Before that commit, the bug was only in Stripe payments. |
Could you work on it? Do you need any help? |
Yes, I ran out of time, but created the pull request now. |
Error in OpenFoodNetwork
ActionView::Template::Error in spree/admin/payments#new
undefined method `amount' for nil:NilClass
View on Bugsnag
Stacktrace
View full stacktrace
Created by Maikel via Bugsnag
The text was updated successfully, but these errors were encountered: