From 6b39d3060b69b6737abed3bdbf00c810bbd213f4 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 28 Feb 2013 09:30:06 -0500
Subject: [PATCH] Inject configuration.

---
 module/VuFind/config/module.config.php                   | 6 +++++-
 module/VuFind/src/VuFind/Controller/RecordController.php | 6 +++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php
index fafc4b7fc77..2b8902083db 100644
--- a/module/VuFind/config/module.config.php
+++ b/module/VuFind/config/module.config.php
@@ -90,6 +90,11 @@ $config = array(
                     $sm->getServiceLocator()->get('VuFind\Config')->get('config')
                 );
             },
+            'record' => function ($sm) {
+                return new \VuFind\Controller\RecordController(
+                    $sm->getServiceLocator()->get('VuFind\Config')->get('config')
+                );
+            },
         ),
         'invokables' => array(
             'admin' => 'VuFind\Controller\AdminController',
@@ -107,7 +112,6 @@ $config = array(
             'missingrecord' => 'VuFind\Controller\MissingrecordController',
             'my-research' => 'VuFind\Controller\MyResearchController',
             'oai' => 'VuFind\Controller\OaiController',
-            'record' => 'VuFind\Controller\RecordController',
             'records' => 'VuFind\Controller\RecordsController',
             'search' => 'VuFind\Controller\SearchController',
             'summon' => 'VuFind\Controller\SummonController',
diff --git a/module/VuFind/src/VuFind/Controller/RecordController.php b/module/VuFind/src/VuFind/Controller/RecordController.php
index c7d416ad22c..bfa7bc0a93b 100644
--- a/module/VuFind/src/VuFind/Controller/RecordController.php
+++ b/module/VuFind/src/VuFind/Controller/RecordController.php
@@ -26,7 +26,6 @@
  * @link     http://vufind.org   Main Site
  */
 namespace VuFind\Controller;
-use VuFind\Config\Reader as ConfigReader;
 
 /**
  * Record Controller
@@ -41,14 +40,15 @@ class RecordController extends AbstractRecord
 {
     /**
      * Constructor
+     *
+     * @param \Zend\Config\Config $config VuFind configuration
      */
-    public function __construct()
+    public function __construct(\Zend\Config\Config $config)
     {
         // Call standard record controller initialization:
         parent::__construct();
 
         // Load default tab setting:
-        $config = ConfigReader::getConfig();
         $this->defaultTab = isset($config->Site->defaultRecordTab)
             ? $config->Site->defaultRecordTab : 'Holdings';
     }
-- 
GitLab