Islandora / islandora

Drupal modules for browsing and managing digital repositories.
http://islandora.ca/
GNU General Public License v2.0
152 stars 118 forks source link

islandora#1059: HTTP error 500 on /media/:mid?_format=jsonld if Media lacks File #1060

Closed xurizaemon closed 4 weeks ago

xurizaemon commented 1 month ago

GitHub Issue: #1059

What does this Pull Request do?

Prevent a (not user facing) error when a Media lacks an associated File and /media/123456?_format=jsonld is requested for the Media item.

Instead of trying to return an @id with the File URI, we return the existing @id which has come from the Media entity.

What's new?

How should this be tested?

Before patch:

  1. Create a Media entity which has no File attached
  2. Request /media/123456?_format=jsonld for that file
  3. See error in Drupal logs

After patch:

  1. Request /media/123456?_format=jsonld for that file
  2. See no error in Drupal logs

Documentation Status

Additional Notes:

Interested parties

CC @seth-shaw-asu @Islandora/committers

seth-shaw-asu commented 1 month ago

Is this still a draft or is it ready to test?

xurizaemon commented 1 month ago

I think it's good to test @seth-shaw-asu - thanks!