Issue Bug Closed

#107524Extending SiteLanguage - Configuration access via Fluid

Robert Winter 09/23/25, 10:28 updated 12/02/25, 13:04

Description

I’ve extended the site language config with a custom field and wanted to access this field via Fluid.

{language.configuration.customfield}

This leads to following error.

Cannot access protected property TYPO3\CMS\Core\Site\Entity\SiteLanguage::$configuration

The problem seems to be the missing getConfiguration method in typo3\cms-core\Classes\Site\Entity\SiteLanguage.php which is e.g. existend in typo3\cms-core\Classes\Site\Entity\Site.php

/**
 * Returns the whole configuration for this site
 */
public function getConfiguration(): array
{
  return $this->configuration;
}

Reviews 2

History 49

  1. Garvin Hicking commented and changed status New Needs Feedback 09/25/25, 18:54

    Have you tried to just access {language.customfield}? (could not try myself yet, but reading the code, everything in $this->configuration seems accessible through the toArray() functionality.

    Hhhm, thinking about this; it seems {language} will always access the object and not invoke the array casting. With {language as array} you would have to assign it to another variable temporarily to accesss it like that.

  2. Robert Winter commented 09/29/25, 13:17

    Direct access is not possible but the cast to an array in fluid would help to tackle the problem temporarily.

  3. Gerrit Code Review pushed patch set 1 for main to change 90849 status Needs Feedback Under Review 09/30/25, 20:32

  4. Gerrit Code Review pushed patch set 2 for main to change 90849 10/07/25, 13:15

  5. Gerrit Code Review pushed patch set 3 for main to change 90849 10/07/25, 13:27

  6. Gerrit Code Review pushed patch set 4 for main to change 90849 10/08/25, 13:23

  7. Gerrit Code Review pushed patch set 1 for 13.4 to change 90961 10/09/25, 07:50

  8. Garvin Hicking commented and changed status Under Review Resolved done 0 % 100 % 10/09/25, 08:10

    Applied in changeset commit:7909a22cfb049d6a44d717a93a1684a57d67578f.

  9. Benni Mack changed status Resolved Closed 12/02/25, 13:04