Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "List of selected items" view with "sort by" setting does not respect language overlay #2369

Open
Idleworks opened this issue Mar 15, 2024 · 3 comments · May be fixed by #2474
Open

The "List of selected items" view with "sort by" setting does not respect language overlay #2369

Idleworks opened this issue Mar 15, 2024 · 3 comments · May be fixed by #2474

Comments

@Idleworks
Copy link
Contributor

Bug Report

Current Behavior
Place a news plugin with view type "List of selected items" on a localized page.
Select default language of one or more single news records.
Select any "Sort by" option e.g. "Given date/time".

Expected behavior/output
Localized news should appear on frontend page but result is an empty page.

Environment

  • TYPO3 version(s): 10.4
  • news version: 9.4.0
  • Is your TYPO3 installation set up with Composer (Composer Mode): yes
  • OS: Windows 11

Possible Solution
If "sort by" option is NOT set, uids of selected news records are passed to findByIdentifier() method of repository which seems to look in uid AND l10n_parent.
If "sort by" option is set, $query->in('uid', X) is used and localizations are missing.

@Idleworks
Copy link
Contributor Author

My possible solution for now is to override NewRepository idList constraint and add l10n_parent:

$idList = $demand->getIdList();
if ($idList) {
    $commaSeparatedIdList = GeneralUtility::intExplode(',', $idList, true);
    $constraints['idList'] = $query->logicalOr(
        $query->in('uid', $commaSeparatedIdList),
        $query->in('l10n_parent', $commaSeparatedIdList)
    );
}

@georgringer
Copy link
Owner

not so sure if this is enough as it could include other news as well

@Idleworks
Copy link
Contributor Author

I have taken a deeper look in TYPO3's repository function "findByUid/findByIdentifier" to understand what is happening when TYPO3 fetches an object directly by it's uid, it sets three query settings:

respectStoragePage => false
Makes sense as we don't want PID restrictions when we ask for a specific uid.
I know that this setting is also set if you as an editor don't select a startpoint page but I had some issues when an editor switches plugin mode and flexform setting was hidden but processed in controller.

respectSysLanguage => false
Backend editors may select record's default language in plugin's flexform field, so don't care what language was selected

languageOverlayMode => true
Overlay selected record to fit current website language

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants