diff --git a/islandlives.module b/islandlives.module index 21dbf25..c78692c 100644 --- a/islandlives.module +++ b/islandlives.module @@ -55,6 +55,12 @@ function islandlives_entity_access(\Drupal\Core\Entity\EntityInterface $entity, return \Drupal\Core\Access\AccessResult::forbidden('Media is not published.'); } } + + $moduleHandler = \Drupal::service('module_handler'); + if (!$moduleHandler->moduleExists('islandora_hierarchical_access')) { + return \Drupal\Core\Access\AccessResult::neutral(); + } + elseif ($entity instanceof \Drupal\file\FileInterface) { // Get all media attached to the files. $media = \Drupal::database()->select(\Drupal\islandora_hierarchical_access\LUTGeneratorInterface::TABLE_NAME, 'lut')