Commit 7240297a authored by Stephan Großberndt's avatar Stephan Großberndt Committed by Christian Kuhn
Browse files

[!!!][TASK] Remove words and words_strings from ReferenceIndex

In ReferenceIndex->generateRefIndexData the strings from all input and
text fields were collected in $this->word_strings. But the array was
never accessed. Remove ReferenceIndex->words (unused) and
ReferenceIndex->word_strings and the collection of word_strings. This
greatly reduces memory usage when bulk inserting or editing records as
well as updating the reference index.

Resolves: #63780
Releases: master, 6.2
Change-Id: I56d6a3e615cab44cbecff5a7d4dec42a1da29fc6
Reviewed-on: http://review.typo3.org/35310


Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 08cdde41
......@@ -51,16 +51,6 @@ class ReferenceIndex {
*/
public $relations = array();
/**
* @var array
*/
public $words_strings = array();
/**
* @var array
*/
public $words = array();
/**
* Number which we can increase if a change in the code means we will have to force a re-generation of the index.
*
......@@ -165,9 +155,6 @@ class ReferenceIndex {
// Get raw record from DB:
$record = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', $table, 'uid=' . (int)$uid);
if (is_array($record)) {
// Initialize:
$this->words_strings = array();
$this->words = array();
// Deleted:
$deleted = $GLOBALS['TCA'][$table]['ctrl']['delete'] && $record[$GLOBALS['TCA'][$table]['ctrl']['delete']] ? 1 : 0;
// Get all relations from record:
......@@ -212,12 +199,6 @@ class ReferenceIndex {
$this->createEntryData_softreferences($table, $uid, $fieldname, '', $deleted, $dat['softrefs']['keys']);
}
}
// Word indexing:
foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $conf) {
if (GeneralUtility::inList('input,text', $conf['config']['type']) && (string)$record[$field] !== '' && !\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($record[$field])) {
$this->words_strings[$field] = $record[$field];
}
}
return $this->relations;
}
}
......
======================================================================================
Breaking: #63780 - Remove public properties words and word_strings from ReferenceIndex
======================================================================================
Description
===========
Public properties words and word_strings are removed from class \TYPO3\CMS\Core\Database\ReferenceIndex.
ReferenceIndex->words was always an empty array and ReferenceIndex->word_strings contained string from
input and text field of every record that was given to this class instance.
Impact
======
An extension relying on one of the public properties to be there will fail.
Affected installations
======================
It is unlikely that any extension used property words or word_strings. An instance could be
checked by searching for usages of class ReferenceIndex.
Migration
=========
The according logic needs to be re-implemented in the extension that used the content of these
properties.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment