From a2245bd7db5e21ad9c4ae7a227cba62ce1cb5433 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Apr 2021 10:13:43 +0200 Subject: [PATCH] Fix add of box --- htdocs/core/class/html.formother.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 18f3fd0f3ce..4fb0a44b06b 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1174,14 +1174,15 @@ class FormOther jQuery("#boxcombo").change(function() { var boxid=jQuery("#boxcombo").val(); if (boxid > 0) { + console.log("A box widget has been selected for addition, we call ajax page to add it.") var left_list = cleanSerialize(jQuery("#boxhalfleft").sortable("serialize")); var right_list = cleanSerialize(jQuery("#boxhalfright").sortable("serialize")); var boxorder = \'A:\' + left_list + \'-B:\' + right_list; jQuery.ajax({ - url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&boxid=\'+boxid+\'&zone='.$areacode.'&userid='.$user->id.'\', - async: false - }); - window.location.search=\'mainmenu='.GETPOST("mainmenu", "aZ09").'&leftmenu='.GETPOST('leftmenu', "aZ09").'&action=addbox&boxid=\'+boxid; + url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&boxid=\'+boxid+\'&zone='.$areacode.'&userid='.$user->id.'\' + }).done(function() { + window.location.search=\'mainmenu='.GETPOST("mainmenu", "aZ09").'&leftmenu='.GETPOST('leftmenu', "aZ09").'\'; + }); } });'; if (!count($arrayboxtoactivatelabel)) {