Skip to content

Commit

Permalink
fix: fixed bad field name when using mm with multiple words
Browse files Browse the repository at this point in the history
  • Loading branch information
benjasper committed Jan 22, 2025
1 parent 2271e6d commit 5e839da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Classes/Resolver/QueryResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Resource\FileRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException;
Expand Down Expand Up @@ -182,7 +183,7 @@ public function fetchForeignRecordsWithMM(

$sorting = $args[QueryArgumentsUtility::$sorting] ?? [];

$mm = $GLOBALS['TCA'][$tableName]['columns'][$resolveInfo->fieldName]['config']['MM'];
$mm = $GLOBALS['TCA'][$tableName]['columns'][GeneralUtility::camelCaseToLowerCaseUnderscored($resolveInfo->fieldName)]['config']['MM'];
$modelClassPath = $schemaContext->getTypeRegistry()->getModelClassPathByTableName($foreignTable);

$qb = $this->connectionPool->getQueryBuilderForTable($foreignTable);
Expand Down Expand Up @@ -266,7 +267,7 @@ public function applyFiltersToQueryBuilder(QueryBuilder $qb, string $modelClassP
array_combine(array_map(static fn($filter) => $filter['path'], $discreteFilters), $discreteFilters);
}
}

if (array_key_exists(QueryArgumentsUtility::$rangeFilters, $filters)) {
if ($filters[QueryArgumentsUtility::$rangeFilters] ?? false) {
$rangeFilters = $filters[QueryArgumentsUtility::$rangeFilters] ?? [];
Expand Down

0 comments on commit 5e839da

Please sign in to comment.