[BUGFIX] ext:dbal: Remove obsolete xclass 81/49581/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 24 Aug 2016 18:21:43 +0000 (20:21 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 24 Aug 2016 18:50:07 +0000 (20:50 +0200)
Method makeSearchString() in DatabaseRecordList has been
migrated to doctrine and is thus dbal compatible.
The registered xclass from ext:dbal can be dropped.

Change-Id: I8599fda63c397e77207f210e5e9b7c789e0f9a83
Resolves: #77623
Releases: master
Reviewed-on: https://review.typo3.org/49581
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/dbal/Classes/RecordList/DatabaseRecordList.php [deleted file]
typo3/sysext/dbal/ext_localconf.php

diff --git a/typo3/sysext/dbal/Classes/RecordList/DatabaseRecordList.php b/typo3/sysext/dbal/Classes/RecordList/DatabaseRecordList.php
deleted file mode 100644 (file)
index f84fa68..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-namespace TYPO3\CMS\Dbal\RecordList;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Child class for rendering of Web > List (not the final class)
- */
-class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList
-{
-    /**
-     * Creates part of query for searching after a word ($this->searchString) fields in input table
-     *
-     * DBAL specific: no LIKE for numeric fields, in this case "uid" (breaks on Oracle)
-     * no LIKE for BLOB fields, skip
-     *
-     * @param string $table, in which the fields are being searched.
-     * @param int $currentPid argument not used in this method, only available for compatibility to parent class
-     * @return string Returns part of WHERE-clause for searching, if applicable.
-     */
-    public function makeSearchString($table, $currentPid = -1)
-    {
-        // Make query, only if table is valid and a search string is actually defined:
-        if ($GLOBALS['TCA'][$table] && $this->searchString) {
-            // Initialize field array:
-            $sfields = array();
-            $or = '';
-            // add the uid only if input is numeric, cast to int
-            if (is_numeric($this->searchString)) {
-                $queryPart = ' AND (uid=' . (int)$this->searchString . ' OR ';
-            } else {
-                $queryPart = ' AND (';
-            }
-            if ($GLOBALS['TYPO3_DB']->runningADOdbDriver('oci8')) {
-                foreach ($GLOBALS['TCA'][$table]['columns'] as $fieldName => $info) {
-                    if ($GLOBALS['TYPO3_DB']->cache_fieldType[$table][$fieldName]['metaType'] === 'B') {
-                    } elseif ($info['config']['type'] === 'text' || $info['config']['type'] === 'input' && !preg_match('/date|time|int/', $info['config']['eval'])) {
-                        $queryPart .= $or . $fieldName . ' LIKE \'%' . $GLOBALS['TYPO3_DB']->quoteStr($this->searchString, $table) . '%\'';
-                        $or = ' OR ';
-                    }
-                }
-            } else {
-                // Traverse the configured columns and add all columns that can be searched
-                foreach ($GLOBALS['TCA'][$table]['columns'] as $fieldName => $info) {
-                    if ($info['config']['type'] === 'text' || $info['config']['type'] === 'input' && !preg_match('/date|time|int/', $info['config']['eval'])) {
-                        $sfields[] = $fieldName;
-                    }
-                }
-                // If search-fields were defined (and there always are) we create the query:
-                if (!empty($sfields)) {
-                    $like = ' LIKE \'%' . $GLOBALS['TYPO3_DB']->quoteStr($this->searchString, $table) . '%\'';
-                    // Free-text
-                    $queryPart .= implode(($like . ' OR '), $sfields) . $like;
-                }
-            }
-            // Return query:
-            return $queryPart . ')';
-        }
-    }
-}
index 499b7ed..5cc05d6 100644 (file)
@@ -2,7 +2,6 @@
 defined('TYPO3_MODE') or die();
 
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Database\DatabaseConnection::class] = array('className' => \TYPO3\CMS\Dbal\Database\DatabaseConnection::class);
 defined('TYPO3_MODE') or die();
 
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Database\DatabaseConnection::class] = array('className' => \TYPO3\CMS\Dbal\Database\DatabaseConnection::class);
-$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class] = array('className' => \TYPO3\CMS\Dbal\RecordList\DatabaseRecordList::class);
 
 // Register caches if not already done in localconf.php or a previously loaded extension.
 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dbal'])) {
 
 // Register caches if not already done in localconf.php or a previously loaded extension.
 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dbal'])) {