Bug #88955

Language restriction is not automatically taken in account with queryBuilder

Added by Florian Rival 3 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2019-08-13
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.1
Tags:
Typo3 v9.5.8
Complexity:
Is Regression:
No
Sprint Focus:

Description

Create a request to get data from a table in a repository :

$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_myext_domain_model_table');
$result = $queryBuilder->select('*')
        ->from('tx_myext_domain_model_table')
        ->where(...$conditions)
        ->execute()
        ->fetchAll();

if the table 'tx_myext_domain_model_table' contains translations for other languages (i.e. sys_language_uid > 0) the result returned include the records for all languages while 'sys_language_uid' should have been automatically filtered for the current language.

History

#1 Updated by Frank Naegler about 1 month ago

  • Category changed from Extbase to Database API (Doctrine DBAL)
  • Status changed from New to Closed
  • Is Regression changed from Yes to No

Thank you for your report, but the issue you describe is not a bug nor a regression.
The QueryBuilder contains the DefaultRestrictionContainer which contains restrictions for deleted and hidden flags and time-based restrictions.
So the language was never taken into account, changing this behavior would be a big breaking change.

For these reasons, I will close the issue. If you think I am wrong please add a comment or open a new issue.

#2 Updated by Florian Rival about 1 month ago

Ok, but in that case it should exist a language restriction that can be added in order to get data only for current language.
This is a feature that we always need when working with QueryBuilder on a multi-language website.

Also available in: Atom PDF