From 1a9675e410b6a4f239ec471904578172ea513956 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 18 Apr 2018 10:12:19 +0200 Subject: [PATCH] FIX: user $backtopage insteead of $backurlforcard --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 5234e4c4911..e44be848179 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -67,7 +67,7 @@ if ($action == 'add' && ! empty($permissiontoadd)) if ($result > 0) { // Creation OK - $urltogo=$backtopage?$backtopage:($backurlforcard?str_replace('__ID__', $result, $backurlforcard):$backurlforlist); + $urltogo=$backtopage?str_replace('__ID__', $result, $backtopage):$backurlforlist; header("Location: ".$urltogo); exit; } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index e9e7a3136bd..764302a8bbc 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -118,7 +118,7 @@ if (empty($reshook)) $permissiontoadd = $user->rights->mymodule->write; $permissiontodelete = $user->rights->mymodule->delete; - $backurlforcard = dol_buildpath('/mymodule/myobject_card.php',1).'?id=__ID__'; + if(empty($backtopage)) $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).'?id=__ID__'; $backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1); // Actions cancel, add, update or delete