diff --git a/classes/statistics/TemporaryTotalsDAO.php b/classes/statistics/TemporaryTotalsDAO.php index 127c11d4071..69e7d13b66a 100644 --- a/classes/statistics/TemporaryTotalsDAO.php +++ b/classes/statistics/TemporaryTotalsDAO.php @@ -20,6 +20,7 @@ namespace APP\statistics; use APP\core\Application; +use DateTimeImmutable; use Illuminate\Support\Facades\DB; use PKP\statistics\PKPTemporaryTotalsDAO; @@ -44,8 +45,8 @@ protected function getInsertData(object $entryData): array */ public function compileIssueMetrics(string $loadId): void { - $date = substr($loadId, -12, 8); - DB::table('metrics_issue')->where('load_id', '=', $loadId)->orWhere('date', '=', DB::raw("DATE({$date})"))->delete(); + $date = DateTimeImmutable::createFromFormat('Ymd', substr($loadId, -12, 8)); + DB::table('metrics_issue')->where('load_id', '=', $loadId)->orWhereDate('date', '=', $date)->delete(); $selectIssueMetrics = DB::table($this->table) ->select(DB::raw('load_id, context_id, issue_id, DATE(date) as date, count(*) as metric')) diff --git a/lib/pkp b/lib/pkp index 36d468f0a7d..fd3942fc266 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit 36d468f0a7d2967b0059732a0d22748f5d2afb3b +Subproject commit fd3942fc2668c3d0f9e08a09f69d13421df463b1