Browse Source

Added recursive derivative check

pull/586/head
Kylea Jackson 10 years ago
parent
commit
9e734d6726
  1. 9
      includes/delete_datastream.form.inc

9
includes/delete_datastream.form.inc

@ -53,7 +53,14 @@ function islandora_datastream_to_purge(AbstractObject $object, $dsid) {
$dsid_map = function ($hook_definition) { $dsid_map = function ($hook_definition) {
return $hook_definition['destination_dsid']; return $hook_definition['destination_dsid'];
}; };
$dsids = array_map($dsid_map, $hooks); $dsids = array();
$derived_dsids = array_map($dsid_map, $hooks);
while ($current = array_pop($derived_dsids)) {
$dsids[] = $current;
$current_derived = islandora_datastream_to_purge($object, $current);
$current_diff = array_diff($current_derived, $derived_dsids, $dsids);
$derived_dsids = array_merge($derived_dsids, $current_diff);
}
return $dsids; return $dsids;
} }

Loading…
Cancel
Save