From a64e7de48ef2d45b5ba1ecaf1f5d5502e8f1c210 Mon Sep 17 00:00:00 2001 From: willtp87 Date: Mon, 21 Apr 2014 15:09:06 -0300 Subject: [PATCH] handling NULL source_dsids in datastream_access hook --- islandora.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/islandora.module b/islandora.module index 9e7809eb..88d7a044 100644 --- a/islandora.module +++ b/islandora.module @@ -1853,7 +1853,8 @@ function islandora_islandora_datastream_access($op, AbstractDatastream $datastre $hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object)); $hooks = islandora_filter_derivatives($hooks, array('force' => TRUE), $object); foreach ($hooks as $hook) { - if ($hook['destination_dsid'] == $datastream->id && islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $object[$hook['source_dsid']], $user)) { + if ($hook['destination_dsid'] == $datastream->id && + (is_null($hook['source_dsid']) || islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $object[$hook['source_dsid']], $user))) { $applicable_hook = TRUE; break; }