Skip to content

Commit

Permalink
[BUGFIX] Working link to word details in indexed_search
Browse files Browse the repository at this point in the history
The indexed_search BE module links to word details.
This link is broken in main and v12:

* In main, the wordHash argument is a string, but the extbase
  target action expects an int.
* In v12, the wordHash is an int, but is misinterpreted as
  pages-uid.

The patch fixes this by switching from the argument name
'id' to 'wordHash' to suppress the pages-uid "convention"
to kick in. In main, the target action argument is declared
as string and both arguments are set non-optional.

Resolves: #103547
Related: #102975
Related: #96797
Related: #103540
Releases: main, 12.4
Change-Id: Ibd4732d086f1af264ee317c7e7d4fe0f15a15aa4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83680
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
lolli42 committed Apr 8, 2024
1 parent ad2f507 commit 7d3c411
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -422,10 +422,10 @@ protected function saveStopwordsKeywordsAction($pageHash, $pageId, $stopwords =
/**
* Statistics for a given word id
*
* @param int $id
* @param int $wordHash
* @param int $pageHash
*/
protected function wordDetailAction($id = 0, $pageHash = 0): ResponseInterface
protected function wordDetailAction($wordHash = 0, $pageHash = 0): ResponseInterface
{
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('index_phash');
$rows = $queryBuilder
Expand All @@ -436,7 +436,7 @@ protected function wordDetailAction($id = 0, $pageHash = 0): ResponseInterface
->where(
$queryBuilder->expr()->eq(
'index_rel.wid',
$queryBuilder->createNamedParameter($id, Connection::PARAM_INT)
$queryBuilder->createNamedParameter($wordHash, Connection::PARAM_INT)
),
$queryBuilder->expr()->eq(
'index_rel.phash',
Expand Down
Expand Up @@ -157,7 +157,7 @@ <h3>
</f:if>
</f:if>
<td>
<f:link.action action="wordDetail" arguments="{id:word.wid,pageHash:phash}">{word.baseword}</f:link.action>
<f:link.action action="wordDetail" arguments="{wordHash:word.wid,pageHash:phash}">{word.baseword}</f:link.action>
</td>
<td>{word.count}</td>
<td>{word.freq}</td>
Expand Down

0 comments on commit 7d3c411

Please sign in to comment.