Resolve PrijavaObnovitevGeslaBlock variable caching issue

This commit is contained in:
Tilen Gombac 2022-10-28 13:04:25 +02:00
parent 5ec14f8378
commit 1f43885ddf
2 changed files with 10 additions and 4 deletions

View File

@ -53,7 +53,7 @@ function prijava_1ka_theme()
'prijava_obnovitev_gesla_block' => [
'variables' => [
'lang' => [],
]
],
'prijava_obnovitev_gesla_aktivacija_blok' => [

View File

@ -20,10 +20,16 @@ class PrijavaObnovitevGeslaBlock extends BlockBase {
* {@inheritdoc}
*/
public function build() {
if(\Drupal::languageManager()->getCurrentLanguage()->getId() == 'sl') {
include(__DIR__ . '../../../../../../../../../lang/1.php');
} else{
include(__DIR__ . '../../../../../../../../../lang/2.php');
}
return [
'#theme' => 'prijava_obnovitev_gesla_block',
];
return [
'#theme' => 'prijava_obnovitev_gesla_block',
'#lang' => $lang ?? [],
];
}
public function getCacheMaxAge() {