From c96a3bfc13105da987e4f41c6c6e52c12f1bfe87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jul 2016 14:14:55 +0200 Subject: [PATCH] Fix when going back on an export page after session has expired to avoid a technical error. --- htdocs/exports/export.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 11ae0fc9218..02a650a2e10 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -638,7 +638,14 @@ if ($step == 2 && $datatoexport) if ($step == 3 && $datatoexport) { - llxHeader('',$langs->trans("NewExport"),'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones'); + if (count($array_selected) < 1) // This occurs when going back to page after sessecion expired + { + // Switch to step 2 + header("Location: ".DOL_URL_ROOT.'/exports/export.php?step=2&datatoexport='.$datatoexport); + exit; + } + + llxHeader('',$langs->trans("NewExport"),'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones'); /* * Affichage onglets @@ -792,6 +799,13 @@ if ($step == 3 && $datatoexport) if ($step == 4 && $datatoexport) { + if (count($array_selected) < 1) // This occurs when going back to page after sessecion expired + { + // Switch to step 2 + header("Location: ".DOL_URL_ROOT.'/exports/export.php?step=2&datatoexport='.$datatoexport); + exit; + } + asort($array_selected); llxHeader('',$langs->trans("NewExport"),'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones'); @@ -1017,6 +1031,13 @@ if ($step == 4 && $datatoexport) if ($step == 5 && $datatoexport) { + if (count($array_selected) < 1) // This occurs when going back to page after sessecion expired + { + // Switch to step 2 + header("Location: ".DOL_URL_ROOT.'/exports/export.php?step=2&datatoexport='.$datatoexport); + exit; + } + asort($array_selected); llxHeader('',$langs->trans("NewExport"),'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones');