Popravki pri modulu registracija, prijava, trgovina

This commit is contained in:
Robert 2022-06-27 16:11:58 +02:00
parent d2bfbff9b1
commit f1f9f7049f
5 changed files with 78 additions and 64 deletions

View File

@ -76,10 +76,18 @@ function prijava_1ka_theme()
];
}
// Development
function prijava_1ka_preprocess_block(&$vars)
/*
* Never cache
*/
function prijava_1ka_preprocess(&$variables)
{
if($vars['plugin_id'] == 'prijava_block'){
$var['#cache'] ['max-age'] = 0;
if(!empty($variables['plugin_id']) && in_array($variables['plugin_id'], [
'prijava_block',
'prijava_obnovitev_gesla_block',
'prijava_obnovitev_gesla_aktivacija_blok',
'prijava_podatki_o_uporabniku_block'
])
){
$variables['#cache'] ['max-age'] = 0;
}
}

View File

@ -87,7 +87,7 @@
<div class="w-clearfix">
<div class="col _3-3-3-12">
<input type="password" name="pass" class="input-field w-input {% if(email == 'error' or password) %}error-field{% endif %}" size="30" placeholder="Geslo" required="required"/>
<input type="password" name="pass" class="input-field prijava-password-input w-input {% if(email == 'error' or password) %}error-field{% endif %}" size="30" placeholder="Geslo" required="required"/>
</div>
</div>

View File

@ -50,10 +50,13 @@ function registracija_1ka_theme()
];
}
// Development
function registracija_1ka_preprocess_block(&$vars)
/*
* Never cache
*/
function registracija_1ka_preprocess(&$variables)
{
if($vars['plugin_id'] == 'registracija_block'){
$var['#cache'] ['max-age'] = 0;
if(!empty($variables['plugin_id']) && $variables['plugin_id'] = 'registracija_block'){
$variables['#cache'] ['max-age'] = 0;
}
}

View File

@ -5,6 +5,7 @@ namespace Drupal\trgovina_1ka\Controller;
use Drupal;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Language\Language;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
@ -137,7 +138,7 @@ class NarociloController extends ControllerBase
$result = curl_exec($ch);
curl_close($ch);
return $result;
return new JsonResponse($result);
}
public function nakupPaketa($paket)