T3Voila / templavoilaplus

TYPO3 Extension TemplaVoilà! Plus for TYPO3 8/9/10/11/12 LTS
https://extensions.typo3.org/extension/templavoilaplus/
GNU General Public License v2.0
26 stars 27 forks source link

Adding content element on alternative language problem #246

Closed agendartobias closed 4 years ago

agendartobias commented 5 years ago

TYPO3 9.5.5 templavoilaplus 7.3.1 or 7.3.0 PHP 7.2

Hey, when i want to add a content element (header,text,plugin - it doesn't matter) on translated page (alternative language id=1) the content element is not addad in page section "tx_templavoilaplus_flex". I must add it manualy -> Edit alternative lang page -> General -> scroll down to Content:[tx_templavoilaplus_flex] -> Content, and there i must find and select that record.

mz-aimcom commented 5 years ago

I can confirm this issue for TYPO3 9.5.5, TV+ 7.3.0.1 and PHP 7.2.

I was able to fix it for new Elements by two changes in Ppi\TemplaVoilaPlus\Service\DataHandling\ServiceDataHandler.php:

Line 213ff:

            case 'new':
                if (!isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tx_templavoilaplus_tcemain']['doNotInsertElementRefsToPage'])
                    || $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tx_templavoilaplus_tcemain']['doNotInsertElementRefsToPage'] == 0
                ) {

Line 233ff:

                    if ($fieldArray['sys_language_uid']) {
                        $translatedParentRecords = BackendUtility::getRecordLocalization('pages', $destinationFlexformPointer['uid'], $fieldArray['sys_language_uid']);
                        if (count($translatedParentRecords) > 0) {
                            $destinationFlexformPointer['uid'] = $translatedParentRecords[0]['uid'];
                        }
                    }

I also created a pull request: #247

Notice: This is not a final fix. As it seems, it only works for the first new translated content element.

opi99 commented 4 years ago

Question to this issue, how do you manage your languages? With SideConfiguration or the old way with sys_languages?

agendartobias commented 4 years ago

Hey, i am using SitesConfiguration

mz-aimcom commented 4 years ago

Hey, i am using SitesConfiguration

Me too. I'm also using Site Configuration.

opi99 commented 4 years ago

So this issue depends on #223 and #266

opi99 commented 4 years ago

I digged again into this issue and found out that the issue is a simple stupid one and haven't todo with my first thoughts on that. I pushed a fix for this into the 7.3.x branch, please test, so I could do another 7.3 release on monday.

agendartobias commented 4 years ago

It works! TNX

opi99 commented 4 years ago

Thanks for feedback