Project

General

Profile

Actions

Bug #65859

open

Support l10n_mode in extbase

Added by Peter Niederlag about 9 years ago. Updated about 1 month ago.

Status:
Under Review
Priority:
Must have
Assignee:
-
Category:
Extbase + l10n
Target version:
-
Start date:
2015-03-20
Due date:
% Done:

0%

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

Description

Intro

Currently extbase lacks support for l10n_mode.

See #62921 for a lengthy discussion of the background. From my point of view support for l10n_mode must explicitly be enabled/added in extbase, that's why I duplicated #62921 here.

Use Case

As Developer I want to be able to assign a relation on a record in the default translation that must not be changed in the translation of the record.
When I set l10n_mode=exclude in $TCA
When I use the \TYPO3\CMS\Extbase\Persistence\QueryInterface to lookup records by a category
Then I expect to find translated records in the Frontend

//$TCA
'faculty' => array(
            'exclude' => 0,
            'l10n_mode' => 'exclude',
            'l10n_display' => 'hideDiff,defaultAsReadonly',
            'label' => 'LLL:EXT:luhjobs/Resources/Private/Language/locallang_db.xlf:tx_luhjobs_domain_model_vacancy.faculty',
            'config' => array(
                'type' => 'select',
                'foreign_table' => 'tx_luhjobs_domain_model_faculty',
                'foreign_table_where' => 'AND tx_luhjobs_domain_model_faculty.sys_language_uid IN (-1,0)',
                'items' => array(
                    array('',''),
                ),
                'minitems' => 1,
                'maxitems' => 1,
            ),
        ),
// QueryInterface
$constraints[] = $query->equals('faculty', $uid);
// resulting SQL(relevant parts only) in case of Frontend with ?L=1
tx_luhjobs_domain_model_vacancy.type = '19' AND tx_luhjobs_domain_model_vacancy.intern = 0
)
AND
(
    tx_luhjobs_domain_model_vacancy.sys_language_uid IN (1,-1)
    OR
    (
        tx_luhjobs_domain_model_vacancy.sys_language_uid=0 AND tx_luhjobs_domain_model_vacancy.uid NOT IN
            (
                SELECT tx_luhjobs_domain_model_vacancy.l10n_parent FROM tx_luhjobs_domain_model_vacancy WHERE tx_luhjobs_domain_model_vacancy.l10n_parent>0 AND tx_luhjobs_domain_model_vacancy.sys_language_uid=1 AND tx_luhjobs_domain_model_vacancy.deleted=0
            )
    )
)

This does miss the translated records as they have faculty=0 due to the l10n_mode=exclude setting in $TCA


Related issues 4 (3 open1 closed)

Related to TYPO3 Core - Bug #62921: l10n_mode with relations does not work in ExtbaseClosed2014-11-13

Actions
Related to TYPO3 Core - Bug #82657: l10n_mode exclude ignored in repositoryNew2017-10-03

Actions
Related to TYPO3 Core - Bug #90430: Language handling of bidirectional mm selects is not consitent.Under ReviewTymoteusz Motylewski2020-02-19

Actions
Related to TYPO3 Core - Story #101566: Extbase related translation issuesNew2023-08-03

Actions
Actions #1

Updated by Peter Niederlag about 9 years ago

  • Description updated (diff)
Actions #2

Updated by Peter Niederlag about 9 years ago

  • Description updated (diff)
Actions #3

Updated by Riccardo De Contardi over 8 years ago

  • Category set to Extbase
Actions #4

Updated by Riccardo De Contardi over 6 years ago

  • Category changed from Extbase to Extbase + l10n
Actions #5

Updated by Benni Mack almost 6 years ago

  • Status changed from New to Needs Feedback

Peter, I guess this is now fixed with TYPO3 v8, can you verify this?

Actions #6

Updated by Johannes Rebhan over 5 years ago

@Benni Mack

Sadly it's not fixed with v8. I've run into the same problem where I have an object which has categories in the base language, then I translate said object with extbase, assign the original object and save it.

The categories field is set as l10n_mode = exclude, but it doesn't work when using core extbase. It seems to work in the backend, because when I edit the translated object (no categories selection shown) and save it - without changing anything - the values are copied. When I do the same in extbase by loading the translated object through a querybuilder query (can't get it any other way in the backend/commandcontrollers), which is then mapped to the object by using DataMapper, it doesn't apply those TCA settings after I've stored with through a repository update().

Actions #7

Updated by Tymoteusz Motylewski over 5 years ago

So querying works but data is not propagated when saving a record through extbase?
This is because extbase doesnt use datahandler for storing values.

Actions #8

Updated by Benni Mack almost 4 years ago

  • Related to Bug #82657: l10n_mode exclude ignored in repository added
Actions #9

Updated by Anonymous almost 3 years ago

Still a thing in 10.4.16

Actions #10

Updated by Riccardo De Contardi over 2 years ago

  • Status changed from Needs Feedback to New
  • TYPO3 Version changed from 6.2 to 10
Actions #11

Updated by Jan Kornblum over 2 years ago

  • Related to Bug #90430: Language handling of bidirectional mm selects is not consitent. added
Actions #12

Updated by Jan Kornblum about 2 years ago

Tymoteusz Motylewski wrote in #note-7:

So querying works but data is not propagated when saving a record through extbase?

Regarding querying, possibly still a (minor) bug: Lets have "product" with two relations "type" (n:1) and "categories" (m:m). For all records (products, types, categories) a translation (L=1) exists.

Now products are queried using the following, while L=1 (and fallbackType=fallback):

// MM - Works fine
$query->contains('categories', $category)
// N:1 - Does NOT work (no records fetched)
$query->equals('type', $type)
// N:1 - DOES work instead (why?)
$query->equals('type', $type->getUid())

Seems there is something missing regarding n:1 relations, when the operand is localized.

Actions #13

Updated by Astrid Haubold 6 months ago

  • Related to Story #101566: Extbase related translation issues added
Actions #14

Updated by Gerrit Code Review about 1 month ago

  • Status changed from New to Under Review

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

Actions #15

Updated by Gerrit Code Review about 1 month ago

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

Actions #16

Updated by Gerrit Code Review about 1 month ago

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

Actions #17

Updated by Gerrit Code Review about 1 month ago

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

Actions #18

Updated by Gerrit Code Review about 1 month ago

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

Actions #19

Updated by Gerrit Code Review about 1 month ago

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

Actions #20

Updated by Gerrit Code Review about 1 month ago

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

Actions #21

Updated by Gerrit Code Review about 1 month ago

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

Actions

Also available in: Atom PDF