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: #3764
Resolves: #3763
  • Loading branch information
dkd-friedrich authored and dkd-kaehm committed Nov 8, 2023
1 parent 99549d9 commit 7972c4a
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 @@ -411,16 +411,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(/** @scrutinizer ignore-type */ $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 7972c4a

Please sign in to comment.