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

Using remote_video media type causes an error because there is no "file" #47

Open
wgilling opened this issue Jul 6, 2021 · 0 comments

Comments

@wgilling
Copy link
Contributor

wgilling commented Jul 6, 2021

When the remote_video media type is used on an item, the code throws an error when trying to call the getSourceFile() method.

This occurs on an item that is using a media type of "remote_video" when navigating to the item's media page such as http://localhost:8000/node/351/media.

The call stack for this error
Error: Call to undefined method Drupal\Core\Field\FieldItemList::referencedEntities() in Drupal\islandora\MediaSource\MediaSourceService->getSourceFile() (line 130 of /var/www/html/drupal/web/modules/contrib/islandora/src/MediaSource/MediaSourceService.php)
#0 /var/www/html/drupal/web/modules/contrib/islandora_riprap/src/Riprap/IslandoraRiprapUtils.php(74): Drupal\islandora\MediaSource\MediaSourceService->getSourceFile(Object(Drupal\media\Entity\Media))
#1 /var/www/html/drupal/web/modules/contrib/islandora_riprap/src/Plugin/views/field/RiprapResults.php(43): Drupal\islandora_riprap\Riprap\IslandoraRiprapUtils->getFedoraUrl('17')
#2 /var/www/html/drupal/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1156): Drupal\islandora_riprap\Plugin\views\field\RiprapResults->render(Object(Drupal\views\ResultRow))

This does not happen unless the remote_video media type is being used. To set this up, as admin navigate to "Add media type": http://localhost:8000/admin/structure/media/add -- NOTE: this media type will also need to have the two fields as are configured for all other islandora media types - these are "media_use" (a taxonomy entity reference) and "media_of" (entity reference) in order to be able to have media of this type show up in the media view without throwing another error.

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

No branches or pull requests

1 participant