CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #38077

Versioned & Localized Records

Added by Matthias Maechler 11 months ago. Updated 11 months ago.

Status:New Start date:2012-06-15
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Votes: 0

Description

Creating a localized record in a draft workspace and display it in the frontend with exbase fails, I could fix the issue for me:

http://typo3.org/api/typo3/_typo3_db_backend_8php_source.html#l00986

Doing the version overlay before the language overlay is the problem, because the localized record that should be selected is related to the standard-language-placeholder-record in the live workspace rather than to it's draft version.

Here's the fix that works for me:

            // - determine table name -
            if ($source instanceof Tx_Extbase_Persistence_QOM_SelectorInterface) {
                $tableName = $source->getSelectorName();
            } elseif ($source instanceof Tx_Extbase_Persistence_QOM_JoinInterface) {
                $tableName = $source->getRight()->getSelectorName();
            }
            // - perform language overlay -
            if($tableName == 'pages') {
                $row = $this->pageSelectObject->getPageOverlay($row, $languageUid);
            } elseif(isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField']) && $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] !== '') {
                if (in_array($row[$GLOBALS['TCA'][$tableName]['ctrl']['languageField']], array(-1,0))) {
                    $overlayMode = ($languageMode === 'strict') ? 'hideNonTranslated' : '';
                    $row = $this->pageSelectObject->getRecordOverlay($tableName, $row, $languageUid, $overlayMode);
                }
            }
            // - no language overlay took place -> try pure version overlay -
            if( $row !== NULL && is_array($row) && !isset( $row['_LOCALIZED_UID'] ) )
                    $this->pageSelectObject->versionOL($tableName, $row, TRUE);
            // - record still there? add it to overlayedRows -
            if ($row !== NULL && is_array($row) ) {
                $overlayedRows[] = $row;
            }

History

Updated by Matthias Maechler 11 months ago

  • Tracker changed from Suggestion to Bug

Also available in: Atom PDF