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

T316: Fixes batch edit bug #543

Merged
merged 1 commit into from
Apr 16, 2024
Merged

T316: Fixes batch edit bug #543

merged 1 commit into from
Apr 16, 2024

Conversation

dolsysmith
Copy link
Contributor

@dolsysmith dolsysmith commented Apr 9, 2024

Fixes #316

Our override of hyrax/forms/batch_edit_form.rb added fields that are not present on all work types, which throws an error when trying to batch edit those work types.

Reverting to the original Hyrax form fixes the bug. However, use of the batch edit involves a significant caveat: the form creates a union of values in each field, so editing a field where the records in the batch have different values in that field will result in all the records getting all the same values. Batch editing should be used only when the goal is to populate all records with the same value in a given field.

If in the future we want to add fields to the batch edit form, we can patch it and append to self.terms.

Testing

  1. Confirm that you can select multiple works on the dashboard and, by clicking the Edit button, open the batch editor.
  2. Confirm that you can modify the value in a field and persist it by clicking Save.

@dolsysmith dolsysmith requested review from kerchner and alepbloyd April 9, 2024 16:29
@dolsysmith dolsysmith changed the title Removing local patch T316: Fixes batch edit bug Apr 9, 2024
Copy link
Contributor

@maxturer maxturer left a comment

Choose a reason for hiding this comment

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

Reviewed this after merging my PR, and can confirm it works on my server!
Can batch edit & save and information persists.

Copy link
Member

@kerchner kerchner left a comment

Choose a reason for hiding this comment

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

👍 Reviewed and tested. Works with both Works and ETDs, and combinations thereof. Due to the behavior noted above (it creates a union of all values in an edited field), we anyhow will only want to use this in very limited situations, and carefully at that. If we need to do more tailored batch edits, and/or batch edits involving fields unique to ETDs, Journal articles, etc., then we may want to use a script or rake task.

@dolsysmith dolsysmith merged commit 7830c24 into master Apr 16, 2024
1 check passed
@dolsysmith dolsysmith deleted the t316-fix-batch-edit branch April 16, 2024 16:50
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.

Batch edit of works throws an error
3 participants