Browse Source

Prevent hooks from being called multiple times.

pull/203/head
Nigel Banks 12 years ago
parent
commit
dd01783050
  1. 5
      includes/utilities.inc
  2. 4
      islandora.module

5
includes/utilities.inc

@ -126,8 +126,9 @@ function islandora_describe_repository($url = NULL) {
function islandora_build_hook_list($hook, $pids = array()) {
$hooks = array();
foreach ($pids as $model) {
$hooks[] = islandora_escape_pid_for_function($model) . '_' . $hook;
$pids = array_unique($pids);
foreach ($pids as $pid) {
$hooks[] = islandora_escape_pid_for_function($pid) . '_' . $hook;
}
$hooks[] = $hook;

4
islandora.module

@ -515,7 +515,7 @@ function islandora_object_load($object_id) {
function islandora_datastream_load($datastream_id, $object_id) {
$object = islandora_object_load($object_id);
if(!$object) {
if (!$object) {
return NULL;
}
@ -784,4 +784,4 @@ function islandora_post_delete_datastream(FedoraObject $object, $datastream_id)
foreach (islandora_build_hook_list(ISLANDORA_POST_PURGE_DATASTREAM_HOOK, $object->models) as $hook) {
module_invoke_all($hook, $object, $datastream_id);
}
}
}

Loading…
Cancel
Save