Skip to content

Commit

Permalink
Fix timestamp precision handling on remote update
Browse files Browse the repository at this point in the history
  • Loading branch information
claussni committed Jun 25, 2024
1 parent 87ddd4c commit 5d4f778
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Classes/Services/Storage/DocumentStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

use DateTime;
use EWW\Dpf\Helper\DateTimePrecision;
use EWW\Dpf\Domain\Model\Document;
use EWW\Dpf\Domain\Model\File;
use EWW\Dpf\Domain\Workflow\DocumentWorkflow;
Expand Down Expand Up @@ -225,7 +226,7 @@ public function update(Document $document, string $state = null)
$state = $containerTuple->getValue('kp:state');
}

$lastModDate = $containerTuple->getValue('fedora:lastModified');
$lastModDate = DateTimePrecision::reducePrecision($containerTuple->getValue('fedora:lastModified'));
$docLastModDate = $document->getRemoteLastModDate();
if ($lastModDate !== $docLastModDate && !empty($docLastModDate)) {
// There is a newer version in the fedora repository.
Expand Down

0 comments on commit 5d4f778

Please sign in to comment.