Project

General

Profile

Actions

Bug #70948

closed

repository doesn't handle l10n_mode "exclude" in some case

Added by Florian Bachmann about 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2015-10-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I have a custom recordtype (reference) which needs to be linked to a couple of pages. That link should not be changed in a translation overlay. So l10n_mode is exclude.
So I created the following TCA-Definition for that field "pages_list"


»···'pages_list' => array(
»···»···'exclude' => 1,
»···»···'label' => 'List of associated pages',
»···»···'config' => array(
»···»···»···'type' => 'select',
»···»···»···'foreign_table' => 'pages',
»···»···»···'size' => '8',
»···»···»···'maxitems' => 100,
»···»···»···'autoSizeMax' => 10,
»···»···»···'renderMode' => 'tree',
»···»···»···'treeConfig' => array(
»···»···»···»···'parentField' => 'pid',
»···»···»···»···'appearance' => array(
»···»···»···»···»···'expandAll' => TRUE,
»···»···»···»···»···'showHeader' => TRUE,
»···»···»···»···»···'maxLevels' => 99,
»···»···»···»···),
»···»···»···),
»···»···),
»···»···'l10n_mode' => 'exclude',
»···»···'l10n_display' => 'defaultAsReadOnly',
»···),

In The ReferenceRepository I need to select all References assigned to a page.

»···public function findByPage($pageId) {
»···»···$references = NULL;
»···»···$query = $this->createQuery();
»···»···$query->getQuerySettings()->setRespectStoragePage(FALSE);

»···»···$constraint = $query->contains('pagesList', $pageId);
»···»···$query->matching($constraint);
»···»···$references = $query->execute();
»···»···return $references;

»···}

The resulting sql-query doesn't seem to respect the l10n_mode, since it requires the translated record (sys_language_uid > 0) to be assigned to that page (in this case 44), which would make sense, if that field would be translatable.

SELECT  tx_vender_domain_model_reference.* FROM tx_vender_domain_model_reference··
»···WHERE FIND_IN_SET('44', tx_vender_domain_model_reference.pages_list)·
»···»···AND (
»···»···»···tx_vender_domain_model_reference.sys_language_uid IN (2,-1)·
»···»···»···OR (
»···»···»···»···tx_vender_domain_model_reference.sys_language_uid=0·
»···»···»···»···AND tx_vender_domain_model_reference.uid NOT IN (
»···»···»···»···»···SELECT tx_vender_domain_model_reference.l10n_parent FROM tx_vender_domain_model_reference·
»···»···»···»···»···WHERE tx_vender_domain_model_reference.l10n_parent>0
»···»···»···»···»···AND tx_vender_domain_model_reference.sys_language_uid=2·
»···»···»···»···»···AND tx_vender_domain_model_reference.deleted=0
»···»···»···»···)
»···»···»···)
»···»···)
·

So this query returns all non-translated records which are assigned to that page (no translation overlay existing), and translated record-overlay rows which are assigned to that page (44) - which is not possible, and will always result in an empty set

For better readability I removed the usual hidden=0, deleted=0.
If anyone asks - TCE-Forms do work perfect.


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #62921: l10n_mode with relations does not work in ExtbaseClosed2014-11-13

Actions
Actions

Also available in: Atom PDF