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

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

Merged

Conversation

xurizaemon
Copy link

@xurizaemon xurizaemon commented Oct 17, 2024

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?

  • When no file is attached and $file is FALSE, do not overwrite the JSON @id value with the file URL
  • Media will then use the Media's URL

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

  • Does this change existing behaviour that's currently documented? NO
  • Does this change require new pages or sections of documentation? NO
  • Who does this need to be documented for? nobody?
  • Associated documentation pull request(s): ___ or documentation issue ___

Additional Notes:

Interested parties

CC @seth-shaw-asu @Islandora/committers

@seth-shaw-asu
Copy link
Member

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

@seth-shaw-asu seth-shaw-asu self-assigned this Oct 23, 2024
@xurizaemon xurizaemon changed the title Draft: islandora#1059: Prevent error when Media lacks a File Draft: islandora#1059: HTTP error 500 on /media/:mid?_format=jsonld if Media has no associated File entity Oct 25, 2024
@xurizaemon xurizaemon changed the title Draft: islandora#1059: HTTP error 500 on /media/:mid?_format=jsonld if Media has no associated File entity Draft: islandora#1059: HTTP error 500 on /media/:mid?_format=jsonld if Media lacks File Oct 25, 2024
@xurizaemon xurizaemon changed the title Draft: islandora#1059: HTTP error 500 on /media/:mid?_format=jsonld if Media lacks File islandora#1059: HTTP error 500 on /media/:mid?_format=jsonld if Media lacks File Oct 25, 2024
@xurizaemon
Copy link
Author

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

@seth-shaw-asu seth-shaw-asu merged commit 9e0d874 into Islandora:2.x Oct 28, 2024
27 checks passed
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