Skip to content

Commit

Permalink
!!![BUGFIX:BP:11.6] Queue check considers indexing configuration
Browse files Browse the repository at this point in the history
As there may be several indexing configurations per type the
queue check has to consider the indexing configuration. The
missing check is added by this commit.

Ports: TYPO3-Solr#3764
Resolves: TYPO3-Solr#3763
  • Loading branch information
dkd-friedrich committed Mar 7, 2024
1 parent 9bb3d38 commit 9d09ea1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 6 additions & 2 deletions Classes/Domain/Index/Queue/QueueItemRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,16 +397,20 @@ public function containsItem(string $itemType, int $itemUid): bool
* @param string $itemType The item's type, usually a table name.
* @param int $itemUid The item's uid
* @param int $rootPageId
* @param string $indexingConfiguration
* @return bool TRUE if the item is found in the queue, FALSE otherwise
*
* @throws DBALDriverException
* @throws DBALException|\Doctrine\DBAL\DBALException
*/
public function containsItemWithRootPageId(string $itemType, int $itemUid, int $rootPageId): bool
public function containsItemWithRootPageId(string $itemType, int $itemUid, int $rootPageId, string $indexingConfiguration): bool
{
$queryBuilder = $this->getQueryBuilderForContainsMethods($itemType, $itemUid);
return (bool)$queryBuilder
->andWhere($queryBuilder->expr()->eq('root', $rootPageId))
->andWhere(
$queryBuilder->expr()->eq('root', $rootPageId),
$queryBuilder->expr()->eq('indexing_configuration', $queryBuilder->createNamedParameter($indexingConfiguration))
)
->execute()
->fetchOne();
}
Expand Down
7 changes: 4 additions & 3 deletions Classes/IndexQueue/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ protected function updateOrAddItemForAllRelatedRootPages(string $itemType, $item
continue;
}
$indexingPriority = $solrConfiguration->getIndexQueueIndexingPriorityByConfigurationName($indexingConfiguration);
$itemInQueueForRootPage = $this->containsItemWithRootPageId($itemType, $itemUid, $rootPageId);
$itemInQueueForRootPage = $this->containsItemWithRootPageId($itemType, $itemUid, $rootPageId, $indexingConfiguration);
if ($itemInQueueForRootPage) {
// update changed time if that item is in the queue already
$changedTime = ($forcedChangeTime > 0) ? $forcedChangeTime : $this->getItemChangedTime($itemType, $itemUid);
Expand Down Expand Up @@ -482,13 +482,14 @@ public function containsItem(string $itemType, $itemUid): bool
* @param int|string $itemUid The item's uid, usually an integer uid, could be a
* different value for non-database-record types.
* @param int $rootPageId
* @param string $indexingConfiguration
* @return bool TRUE if the item is found in the queue, FALSE otherwise
* @throws DBALDriverException
* @throws DBALException|\Doctrine\DBAL\DBALException
*/
public function containsItemWithRootPageId(string $itemType, $itemUid, int $rootPageId): bool
public function containsItemWithRootPageId(string $itemType, $itemUid, int $rootPageId, string $indexingConfiguration): bool
{
return $this->queueItemRepository->containsItemWithRootPageId($itemType, (int)$itemUid, $rootPageId);
return $this->queueItemRepository->containsItemWithRootPageId($itemType, (int)$itemUid, $rootPageId, $indexingConfiguration);
}

/**
Expand Down

0 comments on commit 9d09ea1

Please sign in to comment.