Project

General

Profile

Actions

Bug #83268

closed

QueryGenerator can't deal with multiple alt labels

Added by Hannes Lau over 6 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2017-12-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The QueryGenerator::makeOptionList function reads the label_alt field and uses it as a select field for a db query, forgetting that label_alt may contain multiple field names separated by commas. This leads to an invalid select field name and hence a db error, if the alternative label list does contain a comma.

https://github.com/TYPO3/TYPO3.CMS/blob/c384ce07fcfb33aab6301ce8453f712af8d09008/typo3/sysext/core/Classes/Database/QueryGenerator.php#L900

$altLabelField = $GLOBALS['TCA'][$from_table]['ctrl']['label_alt'];



if ($altLabelField) {
    $selectFields[] = $altLabelField;
}
$queryBuilder->select(...$selectFields)

https://docs.typo3.org/typo3cms/TCAReference/Ctrl/Index.html#label-alt

I discovered this bug while trying to edit a Direct Mail recipient list, based on a special query, based on the tt_address table with a custom select field referring to the static_country_zones table. That table has label_alt 'zn_name_local,zn_code' .


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #77564: Doctrine: Migrate QueryGeneratorClosed2016-08-21

Actions
Actions #1

Updated by Hannes Lau over 6 years ago

  • Related to Task #75545: Doctrine DBAL migration added
Actions #2

Updated by Hannes Lau over 6 years ago

  • Description updated (diff)
Actions #3

Updated by Hannes Lau over 6 years ago

  • Related to deleted (Task #75545: Doctrine DBAL migration)
Actions #4

Updated by Hannes Lau over 6 years ago

  • Related to Task #77564: Doctrine: Migrate QueryGenerator added
Actions #5

Updated by Susanne Moog over 6 years ago

  • Category set to Database API (Doctrine DBAL)
Actions #6

Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70057

Actions #7

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70057

Actions #8

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70057

Actions #9

Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70057

Actions #10

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70057

Actions #11

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70057

Actions #12

Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70057

Actions #13

Updated by Krzysztof Gutkowski over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #14

Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70837

Actions #15

Updated by Krzysztof Gutkowski over 2 years ago

  • Status changed from Under Review to Resolved
Actions #16

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF