diff --git a/core.php b/core.php index 3cd928219..b69fea9c1 100755 --- a/core.php +++ b/core.php @@ -197,7 +197,7 @@ if (!$api_request) { if (!empty($id_module)) { // Segmenti - if (!isset($_SESSION['module_'.$id_module]['id_segment'])) { + if (session('module_'.$id_module.'.id_segment') === null) { $segments = Modules::getSegments($id_module); session(['module_'.$id_module.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]); } diff --git a/include/common/importa.php b/include/common/importa.php index 6cda4c53b..3d12c085c 100755 --- a/include/common/importa.php +++ b/include/common/importa.php @@ -85,7 +85,7 @@ if (!empty($options['create_document'])) { // Opzioni aggiuntive per le Fatture if (in_array($final_module['name'], ['Fatture di vendita', 'Fatture di acquisto'])) { - $id_segment = $_SESSION['module_'.$final_module['id']]['id_segment']; + $id_segment = session('module_'.$final_module['id'].'.id_segment'); $stato_predefinito = $database->fetchOne("SELECT id FROM co_statidocumento WHERE descrizione = 'Bozza'"); diff --git a/include/manager.php b/include/manager.php index d80b15d36..b9d8a4795 100755 --- a/include/manager.php +++ b/include/manager.php @@ -74,7 +74,7 @@ if (!empty($type) && $type != 'menu' && $type != 'custom') { echo '