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

Produce error if viewing a media without a source file (Issue-2110) #874

Merged
merged 1 commit into from
May 20, 2022

Conversation

seth-shaw-unlv
Copy link

GitHub Issue: Islandora/documentation#2110

What does this Pull Request do?

Produces an error message instead of a WSOD when viewing a media where the source file is absent and the fedora URI is set to display.

What's new?

Adds a check to islandora_entity_view around the source file to throw an error and return early if it wasn't found.

  • Does this change add any new dependencies? No.
  • Does this change require any other modifications to be made to the repository
    (i.e. Regeneration activity, etc.)? No.
  • Could this change impact execution of existing code? Makes it not crash.

How should this be tested?

  • Create a media without a source file (this occurred with a broken migration).
    • Create a media via the UI
    • Jump to the command-line and the interactive terminial drush php:cli
    • Load the media, e.g. $m = \Drupal::entityTypeManager()->getStorage('media')->load(1); (replacing "1" with your test media's ID)
    • Get the source file: $f = \Drupal::service('islandora.media_source_service')->getSourceFile($m);
    • Delete it: $f->delete();
    • Clear your cache
  • Make sure the field_gemini_uri is set to display with the media's default mode
  • Visit the media's page and receive a WSOD
  • Apply the PR
  • Visit the media's page again and NOT WSOD.
  • Check the logs to see appropriate error message.

Interested parties

@Islandora/committers

@jordandukart
Copy link
Member

With #869 merged going to re-run tests for sanity's sake but will review this.

@jordandukart jordandukart self-assigned this May 20, 2022
@jordandukart jordandukart merged commit ba74759 into Islandora:2.x May 20, 2022
@jordandukart
Copy link
Member

Does as it says on the tin, 👍.

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.

2 participants