#46297Description Length
Description
The Search Result Description is really short. So 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.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.