Skip to content

Commit

Permalink
[BUGFIX] Exclude relations to tables in sys_refindex
Browse files Browse the repository at this point in the history
The method "shouldExcludeTableFromReferenceIndex()" which
also incorporates a PSR-14 currently only skips references
FROM a specific table, but in order to keep consistency, they
should also be excluded TO this specific table.

Resolves: #89100
Releases: master, 10.4
Change-Id: I0bee4fb12cb461e51a97180addd0b0358fba8412
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65566
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
  • Loading branch information
bmack authored and ervaude committed Sep 4, 2020
1 parent a70f400 commit 7c4d206
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions typo3/sysext/core/Classes/Database/ReferenceIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ public function updateRefIndexTable($tableName, $uid, $testOnly = false)
if (!is_array($relation)) {
continue;
}
// Exclude any relations TO a specific table
if (($relation['ref_table'] ?? '') && $this->shouldExcludeTableFromReferenceIndex($relation['ref_table'])) {
continue;
}
$relation['hash'] = md5(implode('///', $relation) . '///' . $this->hashVersion);
// First, check if already indexed and if so, unset that row (so in the end we know which rows to remove!)
if (isset($currentRelationHashes[$relation['hash']])) {
Expand Down

0 comments on commit 7c4d206

Please sign in to comment.