Browse Source

Force re-load an object when purging so we don't try to access things that no longer exist in Fedora.

pull/452/head
Jordan Dukart 11 years ago
parent
commit
6a1d902de7
  1. 9
      includes/tuque_wrapper.inc

9
includes/tuque_wrapper.inc

@ -298,7 +298,14 @@ class IslandoraFedoraApiM extends FedoraApiM {
default:
$ret = parent::purgeDatastream($pid, $dsid, $params);
islandora_invoke_datastream_hooks(ISLANDORA_DATASTREAM_PURGED_HOOK, $object->models, $dsid, $object, $dsid);
// We need to remove this object from the cache and reload it as
// Tuque may not have an updated copy. That is the datastream could
// still be present within the object even though it's purged out of
// Fedora.
$tuque = islandora_get_tuque_connection();
$tuque->cache->delete($pid);
$non_cached_object = islandora_object_load($pid);
islandora_invoke_datastream_hooks(ISLANDORA_DATASTREAM_PURGED_HOOK, $non_cached_object->models, $dsid, $non_cached_object, $dsid);
return $ret;
}
}

Loading…
Cancel
Save