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

Addressing case where children are added again #4303

Merged
merged 3 commits into from
May 7, 2020
Merged

Addressing case where children are added again #4303

merged 3 commits into from
May 7, 2020

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented May 7, 2020

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

joelakes
joelakes previously approved these changes May 7, 2020
Copy link

@joelakes joelakes left a 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
Copy link
Member

@cjcolvar cjcolvar left a 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.

@jeremyf jeremyf force-pushed the gh-4301 branch 2 times, most recently from 0d856fc to f8fee06 Compare May 7, 2020 16:19
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related?

@jeremyf jeremyf merged commit 56e79ab into 2.x-stable May 7, 2020
@jeremyf jeremyf deleted the gh-4301 branch May 7, 2020 17:36
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

Successfully merging this pull request may close these issues.

4 participants