Skip to content

Commit

Permalink
[BUGFIX] Use latest pagevisit or latest log entry to get time of late…
Browse files Browse the repository at this point in the history
…st visit

Backport of commit 1b73c50

Related: https://projekte.in2code.de/issues/64460
  • Loading branch information
einpraegsam committed Jun 13, 2024
1 parent 70ae0bc commit 99bfdc8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Classes/Domain/Model/Visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1046,10 +1046,20 @@ public function getTstamp(): DateTime
public function getDateOfLastVisit(): ?DateTime
{
$log = $this->getLatestLog();
$pagevisit = $this->getLastPagevisit();

$date = null;
if ($pagevisit !== null) {
$date = $pagevisit->getCrdate();
}
if ($log !== null) {
return $log->getCrdate();
$date = $log->getCrdate();
if ($pagevisit !== null && $pagevisit->getCrdate() > $log->getCrdate()) {
$date = $pagevisit->getCrdate();
}
}
return null;

return $date;
}

/**
Expand Down

0 comments on commit 99bfdc8

Please sign in to comment.