Skip to content

Commit

Permalink
[BUGFIX] Change Parameter Type in customIndexer for ke_search
Browse files Browse the repository at this point in the history
Resolves: #63
  • Loading branch information
tritumdg committed Jul 8, 2022
1 parent ff1add0 commit 602a39f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Expand Up @@ -7,7 +7,6 @@ cache:
variables:
COMPOSER_CACHE_DIR: ".composer"
TYPO3_PATH_WEB: "$CI_PROJECT_DIR/.build/public"
TYPO3_PATH_ROOT: "$CI_PROJECT_DIR/.build/public"
MYSQL_DATABASE: "typo3"
MYSQL_ROOT_PASSWORD: "joh316"
typo3DatabaseName: "typo3"
Expand Down Expand Up @@ -87,6 +86,7 @@ phpstan:analyse:
before_script:
- composer config platform.php 7.4
- composer install --no-progress --no-ansi --no-interaction
- composer req tpwd/ke_search "^4.4"
script:
- .build/bin/phpstan analyse -c Build/phpstan.neon

Expand Down
11 changes: 6 additions & 5 deletions Classes/Hooks/KeSearchIndexer.php
Expand Up @@ -2,15 +2,16 @@
declare(strict_types=1);
namespace Extcode\CartBooks\Hooks;

use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\QueryGenerator;
/*
* This file is part of the package extcode/cart-books.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/

use Tpwd\KeSearch\Indexer\IndexerRunner;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\QueryGenerator;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand All @@ -26,7 +27,7 @@ public function registerIndexerConfiguration(array &$params, $pObj): void
$params['items'][] = $newArray;
}

public function customIndexer(array &$indexerConfig, array &$indexerObject): string
public function customIndexer(array &$indexerConfig, IndexerRunner &$indexerObject): string
{
if ($indexerConfig['type'] === 'cartbookindexer') {
return $this->cartBookIndexer($indexerConfig, $indexerObject);
Expand All @@ -35,7 +36,7 @@ public function customIndexer(array &$indexerConfig, array &$indexerObject): str
return '';
}

public function cartBookIndexer(array &$indexerConfig, array &$indexerObject): string
public function cartBookIndexer(array &$indexerConfig, IndexerRunner &$indexerObject): string
{
$bookIndexerName = 'Book Indexer "' . $indexerConfig['title'] . '"';

Expand Down Expand Up @@ -149,7 +150,7 @@ protected function getBooksToIndex(string $indexPids): array
return $queryBuilder->execute()->fetchAll();
}

protected function getTargetPidFormCategory($categoryUid)
protected function getTargetPidFormCategory(int $categoryUid): ?int
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('sys_category');
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Expand Up @@ -5,7 +5,7 @@
'description' => 'Shopping Cart(s) for TYPO3 - Book Extension',
'category' => 'plugin',
'shy' => false,
'version' => '4.0.3',
'version' => '4.0.4',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
Expand Down

1 comment on commit 602a39f

@vmans
Copy link

@vmans vmans commented on 602a39f Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a complete fix yet, though it does not throw a error:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: strlen(): Argument #1 ($string) must be of type string, int given | TypeError thrown in file /var/www/clients/client2/web19/web/typo3conf/ext/cart_books/Classes/Hooks/KeSearchIndexer.php in line 130. Requested URL: https://etuconsult.nl/typo3/module/web/KeSearchBackendModule?token=--AnonymizedToken--&id=11&do=startindexer

11LTS
ke_search 4.5.1
cart_books 4.0.4

Please sign in to comment.