Browse Source

Allowing more object altering in hooks.

pull/587/head
willtp87 10 years ago
parent
commit
a788cc52a0
  1. 6
      includes/tuque_wrapper.inc
  2. 2
      tests/includes/utilities.inc

6
includes/tuque_wrapper.inc

@ -276,8 +276,10 @@ class IslandoraFedoraApiM extends FedoraApiM {
);
islandora_alter_datastream($object, $datastream, $context);
$params = $context['params'];
if (isset($params['lastModifiedDate'])) {
$params['lastModifiedDate'] = (string) $object[$dsid]->createdDate;
// Anything may be altered during the alter_datastream hook invocation so
// we need to update our time to the change we know about.
if (isset($params['lastModifiedDate']) && $params['lastModifiedDate'] < (string) $object->lastModifiedDate) {
$params['lastModifiedDate'] = (string) $object->lastModifiedDate;
}
if ($context['block']) {
throw new Exception('Modify Datastream was blocked.');

2
tests/includes/utilities.inc

@ -315,7 +315,7 @@ class IslandoraTestUtilities extends IslandoraTestUtilityClass {
*
* @return bool
* TRUE if all objects were removed, or FALSE if any of them still remained
* after removal.
* after removal.
*/
public function deleteUserCreatedObjects($username) {
if ($username === $this->configuration['admin_user']) {

Loading…
Cancel
Save