Skip to content

Commit

Permalink
added check (#1031)
Browse files Browse the repository at this point in the history
* added  check

* blank line

* cleaner implementation

* check added

* tidied up
  • Loading branch information
ajstanley authored Jun 27, 2024
1 parent 849b12a commit 0105343
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions islandora.module
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,11 @@ function islandora_entity_view(array &$build, EntityInterface $entity, EntityVie
$route_match_item = \Drupal::routeMatch()->getParameters()->get($entity->getEntityTypeId());
// Ensure the entity matches the route.
if ($entity === $route_match_item) {
if ($display->getComponent('field_gemini_uri')) {
$mapper = \Drupal::service('islandora.entity_mapper');
$flysystem_config = Settings::get('flysystem');
$fedora_root = $flysystem_config['fedora']['config']['root'];
$flysystem_config = Settings::get('flysystem');
$fedora_root = $flysystem_config['fedora']['config']['root'] ?? NULL;
if ($display->getComponent('field_gemini_uri') && $fedora_root) {
$fedora_root = rtrim($fedora_root, '/');

$mapper = \Drupal::service('islandora.entity_mapper');
if ($entity->getEntityTypeId() == 'media') {
// Check if the source file is in Fedora or not.
$media_source_service = \Drupal::service('islandora.media_source_service');
Expand Down

0 comments on commit 0105343

Please sign in to comment.