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

Fixes the swapping of Thumbnail and Rep. Media per work (#6361). #6371

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

bwatson78
Copy link
Contributor

Fixes

Fixes #6361

Summary

Fixes the swapping of Thumbnail and Representative Media per work

Guidance for testing, such as acceptance criteria or new user interface behaviors:

  • Navigate to a Work that contains more than one file
  • Click on the "File Manager" button
  • Select radio buttons for Thumbnail and Representative Media on an image that is not currently selected
  • Click on "Save" in the Toolbar
  • Navigate back to the Works index page
  • See that Thumbnail and Representative Media have changed
  • Enter File Manager again and see that just chosen image is set as Thumbnail and Representative Media

Type of change (for release notes)

  • notes-bugfix Bug Fixes
  • notes-valkyrie Valkyrie Progress

Detailed Description

Previously, when attempting to change the image assigned to Thumbnail and Representative Media, the Save button wasn't being enabled by Javascript. Once that issue was fixed, clicking Save produced an error: ActionController::InvalidAuthenticityToken. This was caused by Rails needing an authenticity_token assigned to each form. That attribute was assigned in the associated form.

Changes proposed in this pull request:

  • app/assets/javascripts/hyrax/file_manager/member.es6: change the JS method to on instead of trigger.
  • app/views/hyrax/base/_file_manager_resource_form.html.erb: includes the requirement of an authenticity_token.

@samvera/hyrax-code-reviewers

@bwatson78
Copy link
Contributor Author

This may be worth a backport since this fixes the same issue Emory sees in v3.4.2.

@dlpierce dlpierce merged commit d45637e into main Oct 19, 2023
4 checks passed
@dlpierce dlpierce deleted the fix_rep_media_thumbnail_changing_6361 branch October 19, 2023 18:13
@dlpierce dlpierce added the notes-bugfix Release Notes: Fixed a bug label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to change thumbnail and representative media via File Manager
2 participants