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

Deleting an option value while editing another nullifies the update action #6250

Closed
teeg82 opened this issue Apr 1, 2015 · 3 comments
Closed

Comments

@teeg82
Copy link

teeg82 commented Apr 1, 2015

This can be observed while editing the option values of any type (admin/option_types/1/edit for example). Delete an option value, and change one of the fields of another option value, then submit the update. The field you changed is not updated.

This is because the "deleted" row still exists in the form, it is merely hidden. Therefore when the update is submitted, the deleted row is sent back to the server for update, and naturally causes a failure and rollback because the row no longer exists.

The culprit is this function from backend/app/assets/javascripts/spree/backend/admin.js.erb.

Is there a reason for hiding the deleted row, rather than removing it entirely?

@JDutil
Copy link
Member

JDutil commented Apr 3, 2015

I think it would be okay to remove it here this was probably just an oversight by the developer at the time.

@teeg82
Copy link
Author

teeg82 commented Apr 7, 2015

Alright, fair enough. I figured it was just an oversight. I can submit a patch for that a little later if there's no objection.

@JDutil
Copy link
Member

JDutil commented Apr 7, 2015

Pull requests welcome.

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

No branches or pull requests

4 participants