Skip to content

Bulkrax editing without model #1025

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

Merged
merged 2 commits into from
Apr 7, 2025
Merged

Bulkrax editing without model #1025

merged 2 commits into from
Apr 7, 2025

Conversation

laritakr
Copy link
Contributor

@laritakr laritakr commented Apr 4, 2025

Summary

#1024

This commit allows a CSV importer edit to find the object to edit by the identifier rather than requiring the class.

Behavior before change

If a CSV did not include the model, the edit would create new valkyrie works using the defined default model. This resulted in two works in the resource table, with only the newer one indexed. The new work would only contain the metadata present in the edit CSV. The prior work was left untouched.

Behavior after change

The source identifier alone is adequate to find the object to edit, and the importer view shows the correct model name when it links to the edited object.

(Note that it still shows the default type above the raw and parsed metadata)

Screenshot

Screenshot 2025-04-04 at 3 46 07 PM

When editing via a CSV, if the model was omitted or incorrect, bulkrax
had been creating a new new object instead of updating the existing one.
This resulted in two Valkyrie resources with only the new one being
indexed.

This fix updates the `find_by_source_identifier` method (via
`find_by_property_value`) to now find without using the model, to ensure
that we find the existing record. It also updates the importer view to
display the actual model rather than finding so the displayed model
will be correct since may not always be present in the CSV.
@laritakr laritakr force-pushed the bulkrax-editing-without-model branch from b0d8d79 to 8a18fef Compare April 4, 2025 19:23
@laritakr laritakr added the patch-ver for release notes label Apr 4, 2025
Copy link
Member

@orangewolf orangewolf left a comment

Choose a reason for hiding this comment

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

go LaRita! I knew you could do it =-D

@laritakr laritakr marked this pull request as draft April 4, 2025 21:23
@laritakr
Copy link
Contributor Author

laritakr commented Apr 4, 2025

go LaRita! I knew you could do it =-D

There's still apparently some sort of bug due to slugs so I had to move it back to draft for now.

@laritakr laritakr marked this pull request as ready for review April 7, 2025 22:13
@laritakr laritakr merged commit 91c9660 into main Apr 7, 2025
6 of 7 checks passed
@laritakr laritakr deleted the bulkrax-editing-without-model branch April 7, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix patch-ver for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants