From 7c31549f710d10db8b12261373a596c0490473e8 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 16 Jan 2025 17:13:15 +0100 Subject: [PATCH 1/2] FIX societe.class.php uses getCountry, provided by company.lib # FIX Societe.class.php uses getCountry, provided by company.lib Include company.lib.php in societe.class.php. The SocieteTest.php test failed when run independently on windows. --- htdocs/societe/class/societe.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a1a3b9306bb..bc371942fb3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1,4 +1,5 @@ * Copyright (C) 2004-2021 Laurent Destailleur * Copyright (C) 2004 Eric Seigne @@ -20,7 +21,7 @@ * Copyright (C) 2022 ButterflyOfFire * Copyright (C) 2023-2024 Alexandre Janniaux * Copyright (C) 2024 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -45,6 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonsocialnetworks.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonpeople.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; @@ -3192,7 +3194,7 @@ class Societe extends CommonObject if (empty($option) || preg_match('/customer/', $option)) { if (($this->client == 1 || $this->client == 3) && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { $s .= '<'.$tag.' class="customer-back" title="'.dolPrintHTMLForAttribute($langs->trans("Customer")).'"'; - $s.= $tag == 'a' ? ' href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id.'"' : ''; + $s .= $tag == 'a' ? ' href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id.'"' : ''; $s .= '>'.dol_substr($langs->trans("Customer"), 0, 1).''; } } From eadf4c9f5999ee60394172a4bcdd60e2295b9b28 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 16 Jan 2025 17:23:13 +0100 Subject: [PATCH 2/2] Qual: Remove var_dump and exit from SocieteTest --- test/phpunit/SocieteTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 79f40128c59..65ac7f70d96 100644 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -1,7 +1,9 @@ * Copyright (C) 2023 Alexandre Janniaux * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 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 @@ -100,7 +102,6 @@ class SocieteTest extends CommonClassTest $localobject->country_code = 'ES'; $result = $localobject->create($user); - var_dump($localobject);exit; print __METHOD__." result=".$result."\n"; $this->assertLessThanOrEqual($result, 0);