对于3语言站点中的extbase扩展,记录仅在语言0中创建 .
要使用 sys_language_mode = strict
访问这些记录,每个存储库都有一个扩展的 findAll()
方法:
class ApprenticeshipTimeframeRepository扩展\ TYPO3 \ CMS \ Extbase \ Persistence \ Repository {
/**
* @return array An array of objects, empty if no objects found
* @api
*/
public function findAll() {
$query = $this->createQuery();
$query->getQuerySettings()->setRespectSysLanguage(FALSE);
$query->getQuerySettings()->setSysLanguageUid(0);
$result = $query->execute();
return $result;
}
}
这适用 - 但不适用于ObjectStorage(?)属性
从模型:
/**
* Initializes all ObjectStorage properties
*
* @return void
*/
protected function initStorageObjects() {
$this->apprenticeshipFree = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->apprenticeshipOccupied = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->apprenticeshipUnavailable = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->internshipFree = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->internshipOccupied = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->internshipUnavailable = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$this->contactPerson = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
}
所有这些都不会在页面的翻译版本中输出 . 如何强制这些访问L = 0?
PS:可能与https://forge.typo3.org/issues/47192有关?