Project

General

Profile

Actions

Bug #59957

closed

Duplicate code respectively not used variable in sysext\backend\Classes\Search\LiveSearch\LiveSearch.php

Added by Gernot Schulmeister almost 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Code Cleanup
Target version:
-
Start date:
2014-06-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

In the function findByTable($tableName, $pageIdList, $limit) (line 190 in version 6.2.3) the variable $orderBy in line 196 is not used. Instead the function call $this->makeOrderByTable($tableName) is repeated in the next line.

$orderBy = $this->makeOrderByTable($tableName);
$getRecordArray = $this->getRecordArray($tableName, $where, $this->makeOrderByTable($tableName), $limit)
protected function findByTable($tableName, $pageIdList, $limit) {
        $fieldsToSearchWithin = $this->extractSearchableFieldsFromTable($tableName);
        $getRecordArray = array();
        if (count($fieldsToSearchWithin) > 0) {
            $pageBasedPermission = $tableName == 'pages' && $this->userPermissions ? $this->userPermissions : '1=1 ';
            $where = 'pid IN (' . $pageIdList . ') AND ' . $pageBasedPermission . $this->makeQuerySearchByTable($tableName, $fieldsToSearchWithin);
            $orderBy = $this->makeOrderByTable($tableName);
            $getRecordArray = $this->getRecordArray($tableName, $where, $this->makeOrderByTable($tableName), $limit);
        }
        return $getRecordArray;
    }

Solution: remove line 196 or use varible $orderBy in line 197.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #59893: Backend search box: use label_alt field value if label is emtpyClosed2014-06-26

Actions
Actions #1

Updated by Markus Klein almost 10 years ago

Just pushed a patch today, that removes this line.

Actions #2

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from New to Under Review

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31197

Actions #3

Updated by Gerrit Code Review almost 10 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31247

Actions #4

Updated by Markus Klein almost 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31247

Actions #6

Updated by Markus Klein almost 10 years ago

  • Status changed from Under Review to Resolved
Actions #7

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF