Fixed bug #55777: Object manager exceptions raised in TYPO3 6.2
authorstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 7 Feb 2014 21:21:25 +0000 (21:21 +0000)
committerstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 7 Feb 2014 21:21:25 +0000 (21:21 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/sr_freecap/trunk@83691 735d13b6-9817-0410-8766-e36946ffe9aa

ChangeLog
Classes/Domain/Repository/WordRepository.php
Classes/PiBaseApi.php

index a38887a..4b2e1a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-02-07  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #55777: Object manager exceptions raised in TYPO3 6.2
+
 2013-11-26  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #51900: Danish locallang file wrongly named
index 96c56c4..5a3989d 100644 (file)
@@ -45,6 +45,10 @@ class WordRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
         * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
         */
        public function __construct(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager = NULL) {
+               // Get the object manager
+               if ($objectManager === NULL) {
+                       $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               }
                parent::__construct($objectManager);
                // Get an instance of the session storage handler
                $this->sessionStorage = $this->objectManager->get('SJBR\\SrFreecap\\Domain\\Session\\SessionStorage');
index 43ae27d..08dc86f 100644 (file)
@@ -80,7 +80,9 @@ class PiBaseApi {
                
                // Get the configuration manager
                $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
-               $configurationManager->injectObjectManager($this->objectManager);
+               if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 6002000) {
+                       $configurationManager->injectObjectManager($this->objectManager);
+               }
                
                // Get translation view helper
                $translator = $this->objectManager->get('SJBR\\SrFreecap\\ViewHelpers\\TranslateViewHelper');