Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix bugs with errors on update action in Return Authorizations #1340

Closed
wants to merge 1 commit into from

2 participants

@ademidov

NoMethodError raised when you do this steps:
1. Create return authorization for all products in order
2. Receive it
3. Click Update
3. You'll receive an error
undefined methodadmin_return_authorization_url'`
cause of :location => [:admin, @object] gives path without nesting (order/return_authorizations)

Second error is NoMethodError: undefined methodeach' for nil:NilClass`
It occurs when we update recieved Return Authorization because there's no fields 'return_quantity[]' in its edit form.

@radar radar closed this in db43efa
@fonemstr fonemstr referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 30, 2012
  1. @ademidov
This page is out of date. Refresh to see the latest.
View
2  core/app/controllers/spree/admin/resource_controller.rb
@@ -34,7 +34,7 @@ def update
end
else
invoke_callbacks(:update, :fails)
- respond_with(@object, :location => [:admin, @object])
+ respond_with(@object)
end
end
View
2  core/app/controllers/spree/admin/return_authorizations_controller.rb
@@ -14,7 +14,7 @@ def fire
protected
def associate_inventory_units
- params[:return_quantity].each { |variant_id, qty| @return_authorization.add_variant(variant_id.to_i, qty.to_i) }
+ (params[:return_quantity] || []).each { |variant_id, qty| @return_authorization.add_variant(variant_id.to_i, qty.to_i) }
end
end
end
Something went wrong with that request. Please try again.