-
Notifications
You must be signed in to change notification settings - Fork 124
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
Addressing case where children are added again #4303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this change and can confirm that it resolved the issue I raised this morning. I can now edit a Work, add a Keyword and save. The unwanted re-addition of child works is no longer occurring.
Prior to this commit, there was no guard in place to prevent adding children again. The logic would check "is something marked for delete" if not, then add it. That needed to change, because when a user would submit a form changing keywords, then we would re-add all of the already added members. Closes #4301 (which relates to #4193 and #4278) Related to #4302
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Could you please add tests? This sounds like a pretty bad bug so it would be good to ensure we don't have regressions in the future.
0d856fc
to
f8fee06
Compare
Prior to this commit, there were no specs handling the two axis of variance: Axis 1: A work is or is not already an existing member of the parent work. Axis 1: The passed attributes hash has marked an object for destroy, or for addition. This spec is hear to capture that relationshp.
@@ -1,3 +1,4 @@ | |||
require 'csv' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this related?
Prior to this commit, there was no guard in place to prevent adding
children again.
The logic would check "is something marked for delete" if not, then
add it. That needed to change, because when a user would submit a
form changing keywords, then we would re-add all of the already added
members.
Closes #4301 (which relates to #4193 and #4278)
Related to #4302
@samvera/hyrax-code-reviewers