Skip to content

Commit

Permalink
[BUGFIX] Don't index files from hidden file references, fixes #206
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbltr committed Jan 12, 2024
1 parent 0e0481a commit 7125c9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Upcoming version
[TASK] Add label to "Index Overview" widget (shown since TYPO3 12), and use only one color in the bar chart
[TASK] Use ContextualFeedbackSeverity instead of AbstractMessage to set severity
[TASK] Register upgrade wizards using attributes
[BUGFIX] Don't index files from hidden file references. Thanks to Kamel Ben Yedder, https://github.com/tpwd/ke_search/issues/206

Version 5.2.0, 8 December 2023
[!!!] The pagebrowser is now rendered in a different way (using the pagination API). If you used a custom template for the pagebrowser you will have to adopt it. Have a look at Resources/Private/Partials/PageBrowser.html
Expand Down
4 changes: 3 additions & 1 deletion Classes/Indexer/Types/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -983,8 +983,10 @@ public function indexFiles($fileObjects, $ttContentRow, $feGroupsPages, $tags)
$isIndexable = false;
if ($fileObject instanceof FileInterface) {
$file = ($fileObject instanceof FileReference) ? $fileObject->getOriginalFile() : $fileObject;
$isHiddenFileReference = ($fileObject instanceof FileReference) && $fileObject->getProperty('hidden');
$isIndexable = $file instanceof \TYPO3\CMS\Core\Resource\File
&& FileService::isFileIndexable($file, $this->indexerConfig);
&& FileService::isFileIndexable($file, $this->indexerConfig)
&& !$isHiddenFileReference;
} else {
$errorMessage = 'Could not index file in content element #' . $ttContentRow['uid'] . ' (no file object).';
$this->pObj->logger->warning($errorMessage);
Expand Down

0 comments on commit 7125c9a

Please sign in to comment.