diff --git a/includes/tuque_wrapper.inc b/includes/tuque_wrapper.inc index d14a86b3..f5044db0 100644 --- a/includes/tuque_wrapper.inc +++ b/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.'); diff --git a/tests/includes/utilities.inc b/tests/includes/utilities.inc index 4eef5255..eefae4cc 100644 --- a/tests/includes/utilities.inc +++ b/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']) {