Example to fix the #18448

This commit is contained in:
Laurent Destailleur 2021-09-01 19:45:46 +02:00
parent eaf1379751
commit 207328c872

View File

@ -124,8 +124,23 @@ if ($reshook < 0) {
}
if (empty($reshook)) {
$backurlforlist = DOL_URL_ROOT.'/adherents/list.php';
if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
$backtopage = DOL_URL_ROOT.'/adherents/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
}
}
}
if ($cancel) {
if (!empty($backtopage)) {
if (!empty($backtopageforcancel)) {
header("Location: ".$backtopageforcancel);
exit;
} elseif (!empty($backtopage)) {
header("Location: ".$backtopage);
exit;
}