-
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
Allow ContentEventJob to receive either an ActiveFedora object or a Valkyrie resource #4193
Comments
Prior to this commit, the descendants of ContentEventJob each approached writing their `action` string differently. With this change, I've normalized that behavior. There is still work to be done to get a handle on the whole event ecosystem. Relates to: #4193
> When removing a collection after adding it to a work, > CollectionsMembershipActor still adds the collection even though the > _destroy flag is set to true. > > This is happening in both new/update works, in version 2.4.1, 2.7.0, > and most likely 3.x. > > Steps to reproduce the past behavior > > 1. Edit an existing work > 2. Add a collection to the work > 3. Remove the collection (before saving) > 4. Save the work Based on this report, someone via the UI goes to a work, then chooses to add a collection to the work. They then change their mind and mark "delete" for that collection, then go to save. Prior to the logic that is put in place, this would add the collection to the work. The fix now prioritizes checking did someone say delete? If so, go down that logic path else go down the add logic path. Closes #4193 And yes, I did mean to disable to elements for Rubocop. That method is complicated, and while I could extract an inner method, I felt that that was not worth the current effort. I wear my shame proudly.
> When removing a collection after adding it to a work, > CollectionsMembershipActor still adds the collection even though the > _destroy flag is set to true. > > This is happening in both new/update works, in version 2.4.1, 2.7.0, > and most likely 3.x. > > Steps to reproduce the past behavior > > 1. Edit an existing work > 2. Add a collection to the work > 3. Remove the collection (before saving) > 4. Save the work Based on this report, someone via the UI goes to a work, then chooses to add a collection to the work. They then change their mind and mark "delete" for that collection, then go to save. Prior to the logic that is put in place, this would add the collection to the work. The fix now prioritizes checking did someone say delete? If so, go down that logic path else go down the add logic path. Closes #4193 And yes, I did mean to disable to elements for Rubocop. That method is complicated, and while I could extract an inner method, I felt that that was not worth the current effort. I wear my shame proudly.
> When removing a collection after adding it to a work, > CollectionsMembershipActor still adds the collection even though the > _destroy flag is set to true. > > This is happening in both new/update works, in version 2.4.1, 2.7.0, > and most likely 3.x. > > Steps to reproduce the past behavior > > 1. Edit an existing work > 2. Add a collection to the work > 3. Remove the collection (before saving) > 4. Save the work Based on this report, someone via the UI goes to a work, then chooses to add a collection to the work. They then change their mind and mark "delete" for that collection, then go to save. Prior to the logic that is put in place, this would add the collection to the work. The fix now prioritizes checking did someone say delete? If so, go down that logic path else go down the add logic path. Closes #4193 And yes, I did mean to disable to elements for Rubocop. That method is complicated, and while I could extract an inner method, I felt that that was not worth the current effort. I wear my shame proudly.
> When removing a collection after adding it to a work, > CollectionsMembershipActor still adds the collection even though the > _destroy flag is set to true. > > This is happening in both new/update works, in version 2.4.1, 2.7.0, > and most likely 3.x. > > Steps to reproduce the past behavior > > 1. Edit an existing work > 2. Add a collection to the work > 3. Remove the collection (before saving) > 4. Save the work Based on this report, someone via the UI goes to a work, then chooses to add a collection to the work. They then change their mind and mark "delete" for that collection, then go to save. Prior to the logic that is put in place, this would add the collection to the work. The fix now prioritizes checking did someone say delete? If so, go down that logic path else go down the add logic path. Closes #4193
Prior to this commit, the descendants of ContentEventJob each approached writing their `action` string differently. With this change, I've normalized that behavior. There is still work to be done to get a handle on the whole event ecosystem. Relates to: #4193
> When removing a collection after adding it to a work, > CollectionsMembershipActor still adds the collection even though the > _destroy flag is set to true. > > This is happening in both new/update works, in version 2.4.1, 2.7.0, > and most likely 3.x. > > Steps to reproduce the past behavior > > 1. Edit an existing work > 2. Add a collection to the work > 3. Remove the collection (before saving) > 4. Save the work Based on this report, someone via the UI goes to a work, then chooses to add a collection to the work. They then change their mind and mark "delete" for that collection, then go to save. Prior to the logic that is put in place, this would add the collection to the work. The fix now prioritizes checking did someone say delete? If so, go down that logic path else go down the add logic path. Closes #4193
> When removing a collection after adding it to a work, > CollectionsMembershipActor still adds the collection even though the > _destroy flag is set to true. > > This is happening in both new/update works, in version 2.4.1, 2.7.0, > and most likely 3.x. > > Steps to reproduce the past behavior > > 1. Edit an existing work > 2. Add a collection to the work > 3. Remove the collection (before saving) > 4. Save the work Based on this report, someone via the UI goes to a work, then chooses to add a collection to the work. They then change their mind and mark "delete" for that collection, then go to save. Prior to the logic that is put in place, this would add the collection to the work. The fix now prioritizes checking did someone say delete? If so, go down that logic path else go down the add logic path. Closes #4193
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
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
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
Prior to this commit, the descendants of ContentEventJob each approached writing their `action` string differently. With this change, I've normalized that behavior. There is still work to be done to get a handle on the whole event ecosystem. Relates to: #4193
The ContentEventJob has 6 subclasses:
This requires checking their implementations, but I suspect they are almost entirely a "noop" |
The Below are the five places that mixin the
In other words a With that information, I am comfortable closing this issue. |
Descriptive summary
Convert ContentEventJob to allow it to receive either an ActiveFedora based object or a Valkyrie::Resource equivalent object.
Rationale
Allow jobs to execute correctly with existing AF implementation or the Wings Valkyrie implementation.
Expected behavior
ContentEventJob receives a Valkyrie::Resource and performs the action.
Actual behavior
ContentEventJob raises an exception when passed a Valkyrie::Resource.
Approach for Conversion
See Pattern for Jobs Receiving Parameter that may be an AF Object or a Valkyrie Resource
Related work
These have all be modified to support AF object or Valkyrie resource using the established pattern.
The text was updated successfully, but these errors were encountered: