From 1225105324acebe03966e7b5d080c050035358c2 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 28 Jul 2015 10:19:32 -0700 Subject: [PATCH] LogStats: Fix for duplicate-key issue when running log consolidation. --- e107_plugins/log/consolidate.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e107_plugins/log/consolidate.php b/e107_plugins/log/consolidate.php index 148605b21..a3e5af734 100644 --- a/e107_plugins/log/consolidate.php +++ b/e107_plugins/log/consolidate.php @@ -249,10 +249,14 @@ foreach($pageInfo as $key => $info) $pagetotal = serialize($pageTotal); +$insertPageTotal = array('log_data'=> $pageTotal, 'WHERE' => "log_id='pageTotal'"); +$sql->replace('logstats', $insertPageTotal); + +/* if(!$sql->update("logstats", "log_data='{$pagetotal}' WHERE log_id='pageTotal' ")) { $sql->insert("logstats", "0, 'pageTotal', '{$pagetotal}' "); -} +}*/ /* now we need to collate the individual page information into an array ... */