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' => [ 'prijava_obnovitev_gesla_block' => [
'variables' => [ 'variables' => [
'lang' => [],
] ]
], ],
'prijava_obnovitev_gesla_aktivacija_blok' => [ 'prijava_obnovitev_gesla_aktivacija_blok' => [

View File

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