From 656d7b1d56c0336942c6582dd3ef10afd668f1af Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Thu, 9 Apr 2015 16:34:32 -0300 Subject: [PATCH] Changes in ISLANDORA_DERVIATIVE_CREATION_HOOK --- includes/derivatives.inc | 4 ++-- includes/object_properties.form.inc | 2 +- islandora.module | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/derivatives.inc b/includes/derivatives.inc index 7248f03f..74ca2f76 100644 --- a/includes/derivatives.inc +++ b/includes/derivatives.inc @@ -83,7 +83,7 @@ function islandora_do_derivatives(AbstractObject $object, array $options) { $options += array( 'force' => FALSE, ); - $hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object)); + $hooks = islandora_invoke_hook_list(ISLANDORA_DERIVATIVE_CREATION_HOOK, $object->models, array($object)); uasort($hooks, 'drupal_sort_weight'); $results = array(); $hooks = islandora_filter_derivatives($hooks, $options, $object); @@ -176,7 +176,7 @@ function islandora_do_batch_derivatives(AbstractObject $object, array $options) $options += array( 'force' => FALSE, ); - $hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object)); + $hooks = islandora_invoke_hook_list(ISLANDORA_DERIVATIVE_CREATION_HOOK, $object->models, array($object)); uasort($hooks, 'drupal_sort_weight'); $operations = array(); diff --git a/includes/object_properties.form.inc b/includes/object_properties.form.inc index b8fcef7e..ba975803 100644 --- a/includes/object_properties.form.inc +++ b/includes/object_properties.form.inc @@ -29,7 +29,7 @@ function islandora_object_properties_form(array $form, array &$form_state, Abstr $regenerate_derivatives_access = FALSE; if (islandora_object_access(ISLANDORA_REGENERATE_DERIVATIVES, $object)) { module_load_include('inc', 'islandora', 'includes/derivatives'); - $hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object)); + $hooks = islandora_invoke_hook_list(ISLANDORA_DERIVATIVE_CREATION_HOOK, $object->models, array($object)); $hooks = islandora_filter_derivatives($hooks, array('force' => TRUE), $object); if (count($hooks) >= 1) { $regenerate_derivatives_access = TRUE; diff --git a/islandora.module b/islandora.module index 567a39bd..4b5b2320 100644 --- a/islandora.module +++ b/islandora.module @@ -58,7 +58,11 @@ define('ISLANDORA_DATASTREAM_INGESTED_HOOK', 'islandora_datastream_ingested'); define('ISLANDORA_DATASTREAM_MODIFIED_HOOK', 'islandora_datastream_modified'); define('ISLANDORA_DATASTREAM_PURGED_HOOK', 'islandora_datastream_purged'); define('ISLANDORA_INGEST_STEP_HOOK', 'islandora_ingest_steps'); -define('ISLANDORA_DERVIATIVE_CREATION_HOOK', 'islandora_derivative'); +define('ISLANDORA_DERIVATIVE_CREATION_HOOK', 'islandora_derivative'); +// The "ISLANDORA_DERVIATIVE_CREATION_HOOK" constant has deprecated as of +// 7.x-1.5, and should be removed after the next release. +define('ISLANDORA_DERVIATIVE_CREATION_HOOK', ISLANDORA_DERIVATIVE_CREATION_HOOK); + // Autocomplete paths. define('ISLANDORA_CONTENT_MODELS_AUTOCOMPLETE', 'islandora/autocomplete/content-models'); @@ -1946,7 +1950,7 @@ function islandora_islandora_datastream_access($op, AbstractDatastream $datastre module_load_include('inc', 'islandora', 'includes/derivatives'); $applicable_hook = FALSE; $object = $datastream->parent; - $hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object)); + $hooks = islandora_invoke_hook_list(ISLANDORA_DERIVATIVE_CREATION_HOOK, $object->models, array($object)); $hooks = islandora_filter_derivatives($hooks, array('force' => TRUE), $object); foreach ($hooks as $hook) { if (isset($hook['destination_dsid']) && $hook['destination_dsid'] == $datastream->id &&