Skip to content

Commit

Permalink
Fix _ADDTABLE behavoir (#1009)
Browse files Browse the repository at this point in the history
We had issues using the _ADDTABLE parameter after upgrading an old installation from v6.7.3 to v10.0.3:

We use configurations like `[_TABLE:tx_news_domain_model_news;_ADDTABLE:, sys_category_record_mm;_PID:1;_WHERE: hidden = 0 AND tx_news_domain_model_news.uid = sys_category_record_mm.uid_foreign AND uid_local = 2]` to restrict the category for news entries found by the crawler. With your code this results in queries like `SELECT uid FROM , , WHERE (pid IN (?)) AND (hidden = 0 AND tx_news_domain_model_news.uid = sys_category_record_mm.uid_foreign AND uid_local = 1)`. Of course, this will result in an error.

With my changes it is possible to add several additional tables separated by commas. Even our old configuration would work, although the comma at the beginning is no longer needed.

This is only tested with v10.0.3 on TYPO3 v9.5.31 as the upgrade is still in progress...
  • Loading branch information
Hawkeye1909 authored Mar 7, 2024
1 parent e0a6ecf commit a174e52
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Service/ConfigurationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ private function extractParamsFromCustomTable(

if (!empty($addTable)) {
// TODO: Check if this works as intended!
$queryBuilder->add('from', $addTable);
$addTables = GeneralUtility::trimExplode(',', $addTable, true);
foreach ($addTables as $table) {
$queryBuilder->from($table);
}
}
$transOrigPointerField = $GLOBALS['TCA'][$subpartParams['_TABLE']]['ctrl']['transOrigPointerField'] ?? false;

Expand Down

0 comments on commit a174e52

Please sign in to comment.