Skip to content

Commit

Permalink
[TASK] Ignore PHPStan error, closes #154, closes #174
Browse files Browse the repository at this point in the history
PHPStan is complaining that the
SlidingWindowPagination class does not exist in
TYPO3 11, so we ignore this error for now
  • Loading branch information
christianbltr committed Dec 8, 2023
1 parent 7da88b1 commit dd07454
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ChangeLog

Upcoming version
[!!!] The pagebrowser is now rendered in a different way. If you used a custom template for the pagebrowser you will have to adopt it. Have a look at Resources/Private/Partials/PageBrowser.html
[!!!] 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
[TASK] Use pagination API to render pagination, https://github.com/tpwd/ke_search/issues/174 and https://github.com/tpwd/ke_search/issues/154
[TASK] Properly type-hint IndexerBase constructor, thanks to hotbytes-dev, https://github.com/tpwd/ke_search/pull/202
[BUGFIX] Avoid undefined array key warning for "sphinxLimit"
[TASK] Use pagination API to render pagination, https://github.com/tpwd/ke_search/issues/174 and https://github.com/tpwd/ke_search/issues/154

Version 5.1.3, 10 November 2023
[BUGFIX] Replace all occurences of additional word characters, not only the first one. Thanks to K. Quiatkowski. https://github.com/tpwd/ke_search/issues/19
Expand Down
2 changes: 0 additions & 2 deletions Classes/Lib/Pluginbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\LanguageAspect;
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\Plugin\AbstractPlugin;
use TYPO3\CMS\Frontend\Resource\FilePathSanitizer;
Expand Down
2 changes: 2 additions & 0 deletions Classes/Pagination/SlidingWindowPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

/*
* Taken from TYPO3 12 core to make the sliding window pagination available for TYPO3 11
*
* Todo: Remove this file once support for TYPO3 11 is dropped
*/

namespace Tpwd\KeSearch\Pagination;
Expand Down
6 changes: 5 additions & 1 deletion Classes/Plugins/ResultlistPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use Tpwd\KeSearch\Lib\Pluginbase;
use Tpwd\KeSearch\Pagination\SlidingWindowPagination as BackportedSlidingWindowPagination;
use Tpwd\KeSearchPremium\Headless\HeadlessApi;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Pagination\ArrayPaginator;
use TYPO3\CMS\Core\Pagination\SlidingWindowPagination;
use Tpwd\KeSearch\Pagination\SlidingWindowPagination as BackportedSlidingWindowPagination;
use TYPO3\CMS\Core\TypoScript\TypoScriptService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
Expand Down Expand Up @@ -106,6 +106,10 @@ public function main($content, $conf)
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 12) {
$this->fluidTemplateVariables['pagination'] = new BackportedSlidingWindowPagination($paginator, $maxPages);
} else {
// PHPStan is complaining that the SlidingWindowPagination class does not exist in TYPO3 11,
// so we ignore this error for now
// Todo: Remove the PHPStan annotation below once support for TYPO3 11 is dropped
// @phpstan-ignore-next-line
$this->fluidTemplateVariables['pagination'] = new SlidingWindowPagination($paginator, $maxPages);
}

Expand Down

0 comments on commit dd07454

Please sign in to comment.