From c66e087188d5579d3d8ec08f1e000cbe83ade8c0 Mon Sep 17 00:00:00 2001 From: Matthew Perry Date: Mon, 16 Nov 2015 13:02:36 -0400 Subject: [PATCH] Removing passing in the object to prevent any possible confusion and just using the datastream->parent. --- includes/datastream.inc | 2 +- includes/utilities.inc | 8 +++----- theme/theme.inc | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/datastream.inc b/includes/datastream.inc index 8fff2e5a..1c339b61 100644 --- a/includes/datastream.inc +++ b/includes/datastream.inc @@ -296,7 +296,7 @@ function islandora_datastream_get_url(AbstractDatastream $datastream, $type = 'd function islandora_edit_datastream(AbstractDatastream $datastream) { module_load_include('inc', 'islandora', 'includes/utilities'); - $edit_registry = islandora_build_datastream_edit_registry($datastream->parent, $datastream); + $edit_registry = islandora_build_datastream_edit_registry($datastream); $edit_count = count($edit_registry); switch ($edit_count) { case 0: diff --git a/includes/utilities.inc b/includes/utilities.inc index 7db58557..dcbaab02 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -950,18 +950,16 @@ function islandora_deployed_on_windows() { /** * Build the edit registry for a given datastream. * - * @param AbstractObject $object - * The object being edited. * @param AbstractDatastream $datastream * The datastream being edited. * * @return array * The built edit registry array. */ -function islandora_build_datastream_edit_registry($object, $datastream) { - $edit_registry = module_invoke_all(ISLANDORA_EDIT_DATASTREAM_REGISTRY_HOOK, $object, $datastream); +function islandora_build_datastream_edit_registry(AbstractDatastream $datastream) { + $edit_registry = module_invoke_all(ISLANDORA_EDIT_DATASTREAM_REGISTRY_HOOK, $datastream->parent, $datastream); $context = array( - 'object' => $object, + 'object' => $datastream->parent, 'datastream' => $datastream, 'original_edit_registry' => $edit_registry, ); diff --git a/theme/theme.inc b/theme/theme.inc index cd08ee12..dea4a616 100644 --- a/theme/theme.inc +++ b/theme/theme.inc @@ -535,7 +535,7 @@ function theme_islandora_datastream_edit_link(array $vars) { $datastream = $vars['datastream']; module_load_include('inc', 'islandora', 'includes/utilities'); - $edit_registry = islandora_build_datastream_edit_registry($datastream->parent, $datastream); + $edit_registry = islandora_build_datastream_edit_registry($datastream); $can_edit = count($edit_registry) > 0 && islandora_datastream_access(ISLANDORA_METADATA_EDIT, $datastream);