From 614d8021174e219eca4a270cf5e159488e5d3b61 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:26:58 +0100 Subject: [PATCH] Fix getting $id for Object from post # Fix getting $id for Object from post $id was assigned `GETPOSTINT() || GETPOSTINT()` which is a boolean while the objective is to assigne the best id. This fixes that. --- htdocs/societe/ajax/ajaxcompanies.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/ajax/ajaxcompanies.php b/htdocs/societe/ajax/ajaxcompanies.php index f7bb0ce0c60..11de653e6c5 100644 --- a/htdocs/societe/ajax/ajaxcompanies.php +++ b/htdocs/societe/ajax/ajaxcompanies.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2007-2010 Laurent Destailleur * Copyright (C) 2010 Cyrille de Lambert + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,7 +44,10 @@ if (!defined('NOREQUIRESOC')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -$id = GETPOSTINT('socid') || GETPOSTINT('id_fourn'); +$id = GETPOSTINT('socid'); +if ($id == 0) { + $id = GETPOSTINT('id_fourn'); +} $object = new Societe($db); if ($id > 0) {