From a47e449250aed65c0e07ae1d5be6f0cf55065230 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 10 Nov 2016 09:09:19 -0500
Subject: [PATCH] Change event hooked for PostgreSQL bytea initialization. -
 Fixes VUFIND-1214.

---
 module/VuFind/src/VuFind/Db/Table/Search.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/VuFind/src/VuFind/Db/Table/Search.php b/module/VuFind/src/VuFind/Db/Table/Search.php
index 647ca90f9db..aa7d516245f 100644
--- a/module/VuFind/src/VuFind/Db/Table/Search.php
+++ b/module/VuFind/src/VuFind/Db/Table/Search.php
@@ -72,7 +72,7 @@ class Search extends Gateway
             }
             $eventFeature = new Feature\EventFeature();
             $eventFeature->getEventManager()->attach(
-                Feature\EventFeature::EVENT_PRE_INSERT, [$this, 'onPreInsert']
+                Feature\EventFeature::EVENT_PRE_INITIALIZE, [$this, 'onPreInsert']
             );
             $this->featureSet->addFeature($eventFeature);
         }
@@ -81,7 +81,7 @@ class Search extends Gateway
     }
 
     /**
-     * Customize the Insert object to include extra metadata about the
+     * Customize the database object to include extra metadata about the
      * search_object field so that it will be written correctly. This is
      * triggered only when we're interacting with PostgreSQL; MySQL works fine
      * without the extra hint.
-- 
GitLab