Project

General

Profile

Actions

Bug #46718

closed

Description Length

Added by Georg Ringer about 11 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
Start date:
2013-03-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The Search Result Description is really short. So I found the bug in the code. In SearchController around Line 580:

/**
     * Returns the resume for the search-result.
     *
     * @param array $row Search result row
     * @param boolean $noMarkup If noMarkup is FALSE, then the index_fulltext table is used to select the content of the page, split it with regex to display the search words in the text.
     * @param integer $length String length
     * @return string HTML string
     * @todo overwork this
     */
    protected function makeDescription($row, $noMarkup = FALSE, *$length = 180*) {
        if ($row['show_resume']) {
            if (!$noMarkup) {
                $markedSW = '';
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'index_fulltext', 'phash=' . intval($row['phash']));
                if ($ftdrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                    // Cut HTTP references after some length
                    $content = preg_replace('/(http:\\/\\/[^ ]{60})([^ ]+)/i', '$1...', $ftdrow['fulltextdata']);
                    $markedSW = $this->markupSWpartsOfString($content);
                }
                $GLOBALS['TYPO3_DB']->sql_free_result($res);
            }
            if (!trim($markedSW)) {
                $outputStr = $GLOBALS['TSFE']->csConvObj->crop('utf-8', $row['item_description'], $length);
                $outputStr = htmlspecialchars($outputStr);
            }
            $output = $outputStr ? $outputStr : $markedSW;
            $output = $GLOBALS['TSFE']->csConv($output, 'utf-8');
        } else {
            $output = '<span class="noResume">' . \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('result.noResume', 'indexed_search') . '</span>';
        }
        return $output;
    }

The variable name should be $length not $lgd.

Actions #1

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19387

Actions #2

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/19388

Actions #3

Updated by Georg Ringer about 11 years ago

  • Status changed from New to Resolved
  • % Done changed from 10 to 100
Actions #4

Updated by Oliver Hader about 11 years ago

  • Target version changed from 6.1.0-beta1 to 2222
Actions #5

Updated by Oliver Hader about 11 years ago

  • Project changed from 1382 to TYPO3 Core
Actions #6

Updated by Oliver Hader about 11 years ago

  • Category set to Indexed Search
Actions #7

Updated by Oliver Hader about 11 years ago

  • Target version changed from 2222 to 6.0.5
  • TYPO3 Version set to 6.0
Actions #8

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF