FAL FileReferences not localized in FE

In TYPO3 6.2 in my model, I have a common field for files named documents , it ObjectStorage of \TYPO3\CMS\Extbase\Domain\Model\FileReference nothing unusual :)

The problem is with localized pages, only when I create a localized version of my obj object, all its fields are localized correctly, but not documents - it always uses file links by default: / I read about unresolved errors for this, but there is no workaround there ... Can someone suggest me what to do?

If all else fails, I will just write my own FileRef model, but it would be great to avoid this, as there are several places to change.

My field in the model (getter and setter are standard)

 /** * Documents * * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> * @cascade remove */ protected $documents = NULL; 

and in TCA:

 'documents' => array( 'exclude' => 1, 'label' => 'Documents', 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( 'documents', array('maxitems' => 999) ), ), 
+5
source share
1 answer

There are two errors in the TYPO3 interface when it comes to overlaying translations for pages . The reason is that this table uses the dedicated pages_language_overlay table to save these translations.

When translating a page, child records (file links) are not copied to the new localized record. The behavior should be the same as translating a content item. Fixing this behavior will most likely be integrated only in TYPO3 CMS 7 and CMS 8, see issue # 78743 for progress in the following days / weeks.

If you provide file links between the original language entry and the translated entry, which means that the translated entry does not define separate file links, then you can bypass these empty file links when displaying the translated page in the TCA change interface.

 // put that to some TCA Overrides file, eg // typo3conf/ext/my_ext/Configuration/TCA/Overrides/pages_language_overlay.php $GLOBALS['TCA']['pages_language_overlay']['columns']['documents']['l10n_mode'] = 'exclude'; 

Using exclude mode tells TYPO3 to skip overlay for the documents field during rendering in the interface. The overlay process takes place in PageRepository , which is also called by Extbase when the Page model is restored from storage.

+2
source

Source: https://habr.com/ru/post/1233372/


All Articles