From ffce1fd97f3891ae1401ef3507e52c5d6a3c33ea Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Fri, 22 Dec 2023 12:00:36 +0100 Subject: [PATCH 1/2] pkp/pkp-lib#9582 fix get date from string --- classes/statistics/TemporaryTotalsDAO.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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')) From ba39bfa0a8096b1ceaac62ca14d518772ebbeda3 Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Fri, 5 Jan 2024 23:50:54 +0100 Subject: [PATCH 2/2] pkp/pkp-lib#9582 submodule update ##bozana/9582## --- lib/pkp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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