[BUGFIX] Fix fatal error in indexed_search
authorHelmut Hummel <helmut.hummel@typo3.org>
Tue, 20 Nov 2012 23:01:30 +0000 (00:01 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 20 Nov 2012 23:04:53 +0000 (00:04 +0100)
Fixes: #42932
Related: #42806
Releases: 6.0

Change-Id: I05c179c917ed43cb70c2966984080670192713d4
Reviewed-on: http://review.typo3.org/16641
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/frontend/Classes/ContentObject/OffsetTableContentObject.php
typo3/sysext/frontend/Classes/ContentObject/SearchResultContentObject.php

index a6cc409..b16a163 100644 (file)
@@ -46,6 +46,19 @@ class OffsetTableContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstrac
        public $tdParams = ' width="99%" valign="top"';
 
        /**
+        * Override default constructor to make it possible to instantiate this
+        * class for rendering an offset table not in content object context
+        *
+        * @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj
+        */
+       public function __construct(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj = NULL) {
+               if (!is_null($cObj)) {
+                       $this->cObj = $cObj;
+                       $this->fileFactory = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance();
+               }
+       }
+
+       /**
         * Rendering the cObject, OTABLE
         *
         * @param array $conf Array of TypoScript properties
index 97480ea..819ba4a 100644 (file)
@@ -124,6 +124,19 @@ class SearchResultContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstra
        public $listOfSearchFields = '';
 
        /**
+        * Override default constructor to make it possible to instantiate this
+        * class for indexed_search
+        *
+        * @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj
+        */
+       public function __construct(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj = NULL) {
+               if (!is_null($cObj)) {
+                       $this->cObj = $cObj;
+                       $this->fileFactory = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance();
+               }
+       }
+
+       /**
         * Rendering the cObject, SEARCHRESULT
         *
         * @param array $conf Array of TypoScript properties