Bug #104861
closedIndexed Search - total number of results don't shown up (TYPO3 13.2)
100%
Description
Even if displayResultNumber is set to 1, the it only shows up
Anzeige der Ergebnisse 11 bis 12 von insgesamt
Updated by Garvin Hicking 2 months ago ยท Edited
- Status changed from New to Needs Feedback
Updated by wini2 no-lastname-given 2 months ago
changing
<f:render partial="Searchresult" arguments="{row: row, searchParams: searchParams, firstRow: firstRow}" />
in search.html
to
<f:render partial="Searchresult" arguments="{row: row, searchParams: searchParams, firstRow: firstRow, settings: displayResultNumber}" />
<f:render partial="Searchresult" arguments="{row: row, searchParams: searchParams, firstRow: firstRow, settings: settings.displayResultNumber}" />
doesn't help. Could it be, that displyResultNuber is the newly feature to show the number of the result inside the actual result (at the position where the type-icon has been in prior versions)?
Updated by Garvin Hicking 2 months ago
- Status changed from Needs Feedback to Accepted
Yes, I can reproduce this. The Pagination API in this case is IMO broken, probably due to the use of the `SlicePaginator`.
The pagination uses:
{result.pagination.startRecordNumber} - {result.pagination.endRecordNumber} of {result.pagination.totalAmount}.
However, the key totalAmount
does not exist as part of the PaginationInterface
, but is a property of the paginator
which is accessible via the getTotalAmountOfItems
method. However, the SimplePagination
class does not provide a pass-through of that protected paginator's method, so it cannot be retrieved.
Actually, the endRecordNumber
should hold the maximum amount of items in this case, but instead only returns the number of items inside the current slice.
I don't know how to retrieve the totalAmountOfItems
actually, since it's gated by protected getters and not revealed to the outside.
We either need to make this accessible, or we need to adjust the indexedSearch pagination display so that no longer it says "items 1-10 of 25" but instead "show items 1-10 on 1 of 4 pages" or so. One will not now the total amount of results then, but at least the number of pages. :D
Updated by wini2 no-lastname-given 2 months ago
TYPO3 pagination seems to have such a feature https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Breaking-102980-GetAllPageNumbersInPaginationInterface.html#breaking-102980-getallpagenumbers-in-paginationinterface
but I don't know how to use it in indexed_search
Updated by Garvin Hicking 2 months ago
The problem is, getAllPageNumbers() only shows the number of maximum PAGES, not the amount of total ITEMS.
When you have 10 items per page and 9 pages, you could have 91 results or 100.
Updated by Garvin Hicking about 1 month ago
- Related to Feature #105084: Indexed_search Pagination added
Updated by Garvin Hicking about 1 month ago
- Related to Feature #88597: Indexed_Search: Improvement suggestions added
Updated by Mogens Fiebrandt about 1 month ago
I can also reproduce this in TYPO3 13.4.0.
As a workaround i did override the Search.html template and changed line 34.
From:
<f:translate key="displayResults" arguments="{0: result.pagination.startRecordNumber, 1: result.pagination.endRecordNumber, 2: result.pagination.totalAmount}" />
To:
<f:translate key="displayResults" arguments="{0: result.pagination.startRecordNumber, 1: result.pagination.endRecordNumber, 2: result.count}" />
Updated by Garvin Hicking about 1 month ago
- Related to Task #102925: Indexed Search: Migrate rating to ViewHelper added
Updated by Garvin Hicking about 1 month ago
- Related to Task #102945: Replace custom Indexed Search pagination with existing API added
Updated by Gerrit Code Review about 1 month ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86704
Updated by Gerrit Code Review 29 days ago
Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86742
Updated by Garvin Hicking 29 days ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset dd868a232f866bdd770a0180f37c72d09cfffda9.