Bug #86597

Updated by Josef Glatz about 1 year ago

Hello core team,

if only the default language is selected during fallback in the site configuration, the query in the file @sysext/core/Classes/Site/Entity/SiteLanguage.php@ in line "153-155":https://github.com/TYPO3/TYPO3.CMS/blob/a0a37cd2b930abbc25f5e0630c35ee2b273dd5ec/typo3/sysext/core/Classes/Site/Entity/SiteLanguage.php#L153 153-155 no longer works because the query

<pre><code class="php">
if (!empty($attributes['fallbacks']))
</code></pre>


fails because the array Attributes contains

@fallbacks => '0'@.

Instead, it should be checked for @isset@ here.

*Incorrect:*

<pre><code class="php">
if (!empty($attributes['fallbacks'])) {
$this->fallbackLanguageIds = is_array($attributes['fallbacks']) ? $attributes['fallbacks'] : explode(',', $attributes['fallbacks']);
}
</code></pre>

*Correct:*

<pre><code class="php">
if (isset($attributes['fallbacks'])) {
$this->fallbackLanguageIds = is_array($attributes['fallbacks']) ? $attributes['fallbacks'] : explode(',', $attributes['fallbacks']);
}
</code></pre>

Back