Error: Call to a member function getLocale() on null (1)

Permalink
Hello, i have footer.php this simple code:

$Locale = \Concrete\Core\Multilingual\Page\Section\Section::getCurrentSection();
echo $Locale->getLocale();

The language is displayed correctly, but there is an error in the log:
Exception Occurred: /elements/footer.php Call to a member function getLocale() on null (1)

Can you tell me where I make a mistake when everything is displayed correctly?

Version Concrete 5.4.4

I little speak english

 
shahroq replied on at Permalink Reply
shahroq
Hi,
You can find the code for getting active locale here:
https://github.com/shahroq/whale_c5_cheat_sheet#get-active-locale...

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.