From 40925edf08acd348cbe4dd36b75d06b447170212 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Tue, 1 Jul 2014 10:22:47 -0400
Subject: [PATCH] Workarounds for strict SQL standards. - Resolves VUFIND-996.

---
 module/VuFind/src/VuFind/Statistics/Driver/Db.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/module/VuFind/src/VuFind/Statistics/Driver/Db.php b/module/VuFind/src/VuFind/Statistics/Driver/Db.php
index f41419cc771..33399672eb9 100644
--- a/module/VuFind/src/VuFind/Statistics/Driver/Db.php
+++ b/module/VuFind/src/VuFind/Statistics/Driver/Db.php
@@ -55,6 +55,13 @@ class Db extends AbstractBase implements \VuFind\Db\Table\DbTableAwareInterface
      */
     public function write($data, $userData)
     {
+        // Unset the coded-in datestamp, since the database will auto-generate
+        // it internally with greater accuracy.
+        unset($userData['datestamp']);
+
+        // Make sure the browser version is a legal length.
+        $userData['browserVersion'] = substr($userData['browserVersion'], 0, 8);
+
         $this->getTable('UserStatsFields')->save($data, $userData);
     }
 
-- 
GitLab