From 805bf6442858f563887444874432ab51d52c24c4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 8 Jan 2023 15:00:58 +0100 Subject: [PATCH 1/5] Fix php 8 error --- htdocs/public/payment/newpayment.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 79104817e77..144506ab7b6 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1039,6 +1039,7 @@ if ($source == 'order') { $amount = price2num($amount); } + $tag = ''; if (GETPOST('fulltag', 'alpha')) { $fulltag = GETPOST('fulltag', 'alpha'); } else { From f649fcf8cfdbd00097583b3679e2029922f41057 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 8 Jan 2023 15:48:23 +0100 Subject: [PATCH 2/5] Fix php 8 errors --- htdocs/core/tpl/card_presend.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 84b051d24f3..2393524e572 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -40,7 +40,7 @@ if ($action == 'presend') { $titreform = 'SendMail'; $object->fetch_projet(); - + if (!isset($file)) $file = null; $ref = dol_sanitizeFileName($object->ref); if (!in_array($object->element, array('user', 'member'))) { //$fileparams['fullname'] can be filled from the card @@ -57,7 +57,7 @@ if ($action == 'presend') { } } - $file = $fileparams['fullname']; + $file = isset($fileparams['fullname'])?$fileparams['fullname']:null; } // Define output language From f08407e59736a5a51a9a860cb057790c75681b4c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 8 Jan 2023 17:07:59 +0100 Subject: [PATCH 3/5] Fix php 8 errors --- htdocs/don/card.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 459c892a1d9..ec22c82543f 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -52,7 +52,7 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); - +$socid = GETPOST('socid', 'int'); $amount = price2num(GETPOST('amount', 'alphanohtml'), 'MT'); $donation_date = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); @@ -63,6 +63,13 @@ if ($id > 0 || $ref) { $object->fetch($id, $ref); } +if (!empty($socid) && $socid > 0) { + $soc = new Societe($db); + if ($socid > 0) { + $soc->fetch($socid); + } +} + $extrafields = new ExtraFields($db); // fetch optionals attributes and labels From 6962d4aaa3cb515837693cb2a3c3255b2b3b56c8 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 8 Jan 2023 17:10:30 +0100 Subject: [PATCH 4/5] Update list.php --- htdocs/don/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index ac704571daa..c2f89ebc759 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -59,6 +59,7 @@ $search_status = (GETPOST("search_status", 'intcomma') != '') ? GETPOST("search_ $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_ref = GETPOST('search_ref', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); +$search_thirdparty = GETPOST('search_thirdparty', 'alpha'); $search_name = GETPOST('search_name', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); @@ -71,6 +72,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_all = ""; $search_ref = ""; $search_company = ""; + $search_thirdparty = ""; $search_name = ""; $search_amount = ""; $search_status = ''; From 23013282ffddccea472bae55ba8741fcf328b1d3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 8 Jan 2023 21:30:12 +0100 Subject: [PATCH 5/5] Fix php 8 error if empty value, there is an error when doc is generated --- htdocs/core/class/commondocgenerator.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 82012400f68..e1780985c7c 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1288,7 +1288,8 @@ abstract class CommonDocGenerator } $extrafields = $this->extrafieldsCache; - $extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element); + $extrafieldOutputContent = ''; + if (isset($object->array_options[$extrafieldOptionsKey])) $extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element); // TODO : allow showOutputField to be pdf public friendly, ex: in a link to object, clean getNomUrl to remove link and images... like a getName methode ... if ($extrafields->attributes[$object->table_element]['type'][$extrafieldKey] == 'link') {