b13 / container

A TYPO3 Extension for creating custom nested content elements
GNU General Public License v2.0
168 stars 62 forks source link

Content-Elements with sys_language_uid === -1 are only shown in the language they're in #478

Open BeerOnTheBeach opened 8 months ago

BeerOnTheBeach commented 8 months ago

Description Content-Elements inside b13-containers are not shown in other languages if the language is set to "all languages".

How to reproduce Could reproduce it in a fresh TYPO3 v11.5.35 installation with only the b13/container (2.3.5) and the b13/container-example (2.0.0) installed.

  1. Add another language
  2. Create a container, add Content-Element
  3. Set both to language "All languages"

image

Solution approach

Not sure if I'm on the correct path here, but I've noticed that the container/Classes/Domain/Factory/PageView/Frontend/ContainerFactory.php:95 is only checking if the language is > 0. Checking if the record-language is -1 would fix this. Testing this seemed to not break anything, but I'm not 100% sure tbh.

This would be the diff:

--- public/typo3conf/ext/container/Classes/Domain/Factory/PageView/Frontend/ContainerFactory.php
+++ public/typo3conf/ext/container/Classes/Domain/Factory/PageView/Frontend/ContainerFactory.php
@@ -92,7 +92,7 @@
         }

         $defaultRecord = null;
-        if ($record['sys_language_uid'] > 0) {
+        if ($record['sys_language_uid'] > 0 || $record['sys_language_uid'] === -1) {
             $defaultRecord = $this->defaultContainer($record);
             if ($defaultRecord === null) {
                 // free mode
chesio commented 8 months ago

Hi @BeerOnTheBeach, this is not supported - see #237.

BeerOnTheBeach commented 8 months ago

hi @chesio,

thanks for the hint. Seems this is never gonna happen then, huh?