Qual: Fix CI notices after changes to fields type (#37934)

* Qual: CI notices after changes to fields type

# Qual: CI notices after changes to fields type

The phpstan regexes to ignore notices no longer matched because of the type change.
Update the code to fix the notices.

* Qual: Ignore false positive (Phan)
This commit is contained in:
MDW 2026-04-20 12:38:14 +02:00 committed by GitHub
parent 1743565a50
commit 43a958b925
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 28 additions and 136 deletions

View file

@ -888,12 +888,6 @@ parameters:
count: 1
path: ../../../htdocs/asset/card.php
-
message: '#^Property Asset\:\:\$fields \(array\<string, array\{type\: string, label\: string, langfile\?\: string, enabled\: int\<0, 2\>\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\}\>\) does not accept non\-empty\-array\<string, array\{type\: ''integer…'', label\: ''SupplierInvoice'', enabled\: ''1'', noteditable\: 1, position\: 280, notnull\: 0, visible\: 1, index\: 1, \.\.\.\}\|array\{type\: string, label\: string, langfile\?\: string, enabled\: int\<0, 2\>\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\}\>\.$#'
identifier: assign.propertyType
count: 1
path: ../../../htdocs/asset/card.php
-
message: '#^Call to function is_callable\(\) with array\{\$this\(AssetDepreciationOptions\), ''validateField''\} will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -1146,12 +1140,6 @@ parameters:
count: 1
path: ../../../htdocs/bookmarks/bookmarks.lib.php
-
message: '#^Variable \$result might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/categories/card.php
-
message: '#^Loose comparison using \=\= between ''hierarchy'' and ''common'' will always evaluate to false\.$#'
identifier: equal.alwaysFalse
@ -1164,12 +1152,6 @@ parameters:
count: 1
path: ../../../htdocs/categories/categorie_list.php
-
message: '#^Strict comparison using \=\=\= between array\{type\: string, label\: string, langfile\?\: string, enabled\: int\<0, 2\>\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\} and null will always evaluate to false\.$#'
identifier: identical.alwaysFalse
count: 1
path: ../../../htdocs/categories/categorie_list.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
@ -1302,12 +1284,6 @@ parameters:
count: 2
path: ../../../htdocs/comm/action/index.php
-
message: '#^Variable \$socid might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/comm/action/info.php
-
message: '#^Call to function is_array\(\) with array\<mixed\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -1980,12 +1956,6 @@ parameters:
count: 3
path: ../../../htdocs/compta/cashcontrol/cashcontrol_card.php
-
message: '#^Strict comparison using \=\=\= between array\{type\: string, label\: string, langfile\?\: string, enabled\: int\<0, 2\>\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\} and null will always evaluate to false\.$#'
identifier: identical.alwaysFalse
count: 1
path: ../../../htdocs/compta/cashcontrol/cashcontrol_list.php
-
message: '#^Call to function method_exists\(\) with \$this\(CashControl\) and ''getLibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -4176,12 +4146,6 @@ parameters:
count: 1
path: ../../../htdocs/core/class/html.formother.class.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 1
path: ../../../htdocs/core/class/html.formprojet.class.php
-
message: '#^Variable \$labeltoshow might not be defined\.$#'
identifier: variable.undefined
@ -6756,18 +6720,6 @@ parameters:
count: 2
path: ../../../htdocs/fourn/commande/card.php
-
message: '#^Variable \$line might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../../htdocs/fourn/commande/card.php
-
message: '#^Variable \$num might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/fourn/commande/card.php
-
message: '#^Right side of && is always false\.$#'
identifier: booleanAnd.rightAlwaysFalse
@ -6780,12 +6732,6 @@ parameters:
count: 2
path: ../../../htdocs/fourn/commande/dispatch.php
-
message: '#^Variable \$comment might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../../htdocs/fourn/commande/dispatch.php
-
message: '#^Variable \$product might not be defined\.$#'
identifier: variable.undefined
@ -7314,12 +7260,6 @@ parameters:
count: 1
path: ../../../htdocs/hrm/job_card.php
-
message: '#^Strict comparison using \=\=\= between array\{type\: string, label\: string, langfile\?\: string, enabled\: int\<0, 2\>\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\} and null will always evaluate to false\.$#'
identifier: identical.alwaysFalse
count: 1
path: ../../../htdocs/hrm/job_list.php
-
message: '#^Comparison operation "\<" between int\<0, max\> and 0 is always false\.$#'
identifier: smaller.alwaysFalse
@ -7332,12 +7272,6 @@ parameters:
count: 1
path: ../../../htdocs/hrm/position.php
-
message: '#^Property Position\:\:\$fields \(array\<string, array\{type\: string, label\: string, langfile\?\: string, enabled\: int\<0, 2\>\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\}\>\) does not accept non\-empty\-array\<string, array\{\}\|array\{type\: string, label\: string, langfile\?\: string, enabled\: int\<0, 2\>\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\}\>\.$#'
identifier: assign.propertyType
count: 1
path: ../../../htdocs/hrm/position_agenda.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
@ -8226,12 +8160,6 @@ parameters:
count: 1
path: ../../../htdocs/modulebuilder/template/myobject_list.php
-
message: '#^Strict comparison using \=\=\= between array\{type\: string, label\: string, langfile\?\: string, enabled\: int\<0, 2\>\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\} and null will always evaluate to false\.$#'
identifier: identical.alwaysFalse
count: 1
path: ../../../htdocs/modulebuilder/template/myobject_list.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
@ -8460,12 +8388,6 @@ parameters:
count: 1
path: ../../../htdocs/partnership/class/partnership.class.php
-
message: '#^Call to function property_exists\(\) with \$this\(Partnership\) and ''fk_soc'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/partnership/class/partnership.class.php
-
message: '#^Call to function property_exists\(\) with \$this\(Partnership\) and ''thirdparty'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -8505,7 +8427,7 @@ parameters:
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 2
count: 1
path: ../../../htdocs/partnership/class/partnership.class.php
-
@ -8538,12 +8460,6 @@ parameters:
count: 1
path: ../../../htdocs/partnership/partnership_card.php
-
message: '#^Variable \$adht might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/partnership/partnership_card.php
-
message: '#^Variable \$soc might not be defined\.$#'
identifier: variable.undefined
@ -8556,12 +8472,6 @@ parameters:
count: 1
path: ../../../htdocs/partnership/partnership_list.php
-
message: '#^Ternary operator condition is always true\.$#'
identifier: ternary.alwaysTrue
count: 2
path: ../../../htdocs/partnership/partnership_list.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
@ -11586,12 +11496,6 @@ parameters:
count: 1
path: ../../../htdocs/webhook/target_card.php
-
message: '#^Strict comparison using \=\=\= between array\{type\: string, label\: string, langfile\?\: string, enabled\: int\<0, 2\>\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\} and null will always evaluate to false\.$#'
identifier: identical.alwaysFalse
count: 1
path: ../../../htdocs/webhook/triggerhistory_list.php
-
message: '#^Result of && is always false\.$#'
identifier: booleanAnd.alwaysFalse

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025-2026 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -282,9 +282,6 @@ foreach ($search as $key => $val) {
continue;
}
$field_spec = $object->fields[$key];
if ($field_spec === null) {
continue;
}
$mode_search = (($object->isInt($field_spec) || $object->isFloat($field_spec)) ? 1 : 0);
if ((strpos($field_spec['type'], 'integer:') === 0) || (strpos($field_spec['type'], 'sellist:') === 0) || !empty($field_spec['arrayofkeyval'])) {
if ($search[$key] == '-1' || ($search[$key] === '0' && !isset($field_spec['arrayofkeyval']['0']))) {

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2007-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025-2026 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -131,11 +131,11 @@ foreach ($object->fields as $key => $val) {
if (!empty($val['visible'])) {
$visible = (int) dol_eval((string) $val['visible'], 1);
$arrayfields[$tableprefix.'.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? '0' : '1'),
'enabled'=>(string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
'label' => $val['label'],
'checked' => (($visible < 0) ? '0' : '1'),
'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
'position' => $val['position'],
'help' => isset($val['help']) ? $val['help'] : ''
);
}
}
@ -266,9 +266,6 @@ foreach ($search as $key => $val) {
continue;
}
$field_spec = $object->fields[$key];
if ($field_spec === null) {
continue;
}
$mode_search = (($object->isInt($field_spec) || $object->isFloat($field_spec)) ? 1 : 0);
if ((strpos($field_spec['type'], 'integer:') === 0) || (strpos($field_spec['type'], 'sellist:') === 0) || !empty($field_spec['arrayofkeyval'])) {
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($field_spec['arrayofkeyval']) || !array_key_exists('0', $field_spec['arrayofkeyval'])))) {
@ -299,7 +296,7 @@ foreach ($search as $key => $val) {
}
} else {
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
$columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key);
$columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
if (preg_match('/_dtstart$/', $key)) {
$sql .= " AND t.".$db->sanitize($columnName)." >= '".$db->idate($search[$key])."'";
@ -468,8 +465,8 @@ print '<input type="hidden" name="mode" value="'.$mode.'">';
$permforcashfence = 1;
$newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
$newcardbutton .= dolGetButtonTitleSeparator();
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permforcashfence);
@ -579,7 +576,7 @@ foreach ($object->fields as $key => $val) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
$parameters = array('arrayfields' => $arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@ -623,7 +620,7 @@ foreach ($object->fields as $key => $val) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@ -809,7 +806,7 @@ if ($num == 0) {
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View file

@ -4,7 +4,7 @@
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2023 Nick Fragoulis
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
* This program is free software; you can redistribute it and/or modify
@ -615,7 +615,7 @@ abstract class CommonInvoice extends CommonObject
// List of payments
if (empty($mode) || $mode == 1) {
$sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".($field3 ? ", ".$this->db->sanitize($field3) : "") . ($field4 ? ", ".$this->db->sanitize($field4) : "");
$sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".($field3 ? ", ".$this->db->sanitize($field3) : "") . (", ".$this->db->sanitize($field4));
$sql .= " FROM ".$this->db->prefix().$table." as pf, ".$this->db->prefix().$table2." as p, ".$this->db->prefix()."c_paiement as t";
$sql .= " WHERE pf.".$this->db->sanitize($field)." = ".((int) $this->id);
$sql .= " AND pf.".$this->db->sanitize($field2)." = p.rowid";
@ -734,7 +734,7 @@ abstract class CommonInvoice extends CommonObject
// If not a draft invoice and not temporary invoice
if ($tmppart !== 'PROV') {
if ($this instanceOf Facture) {
if ($this instanceof Facture) {
/* @var Facture $this */
// If sent by email, we refuse
if ((int) $this->email_sent_counter > 0) {
@ -906,7 +906,7 @@ abstract class CommonInvoice extends CommonObject
// If not a draft invoice and not temporary invoice
if ($tmppart !== 'PROV') {
if ($this instanceOf Facture) {
if ($this instanceof Facture) {
/* @var Facture $this */
// If sent by email, we refuse
if ((int) $this->email_sent_counter > 0) {
@ -1253,7 +1253,7 @@ abstract class CommonInvoice extends CommonObject
'paye' => $paye,
'alreadypaid' => $alreadypaid,
'type' => $type,
'paramsBadge'=>& $paramsBadge
'paramsBadge' => & $paramsBadge
);
$reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook
@ -1438,7 +1438,7 @@ abstract class CommonInvoice extends CommonObject
$sql .= " AND type = 'ban'"; // To exclude record done for some online payments
$sql .= " AND traite = 0"; // Not yet in a transfer receipt
dol_syslog(get_class($this)."::demande_prelevement - get pending requests not yet in receipt", LOG_DEBUG);
$resql= $this->db->query($sql);
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
$total_already_requested += $obj ? (float) $obj->total_requested : 0;

View file

@ -5,7 +5,7 @@
* Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
* Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025-2026 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -266,9 +266,6 @@ foreach ($search as $key => $val) {
continue;
}
$field_spec = $object->fields[$key];
if ($field_spec === null) {
continue;
}
$mode_search = (($object->isInt($field_spec) || $object->isFloat($field_spec)) ? 1 : 0);
if ((strpos($field_spec['type'], 'integer:') === 0) || (strpos($field_spec['type'], 'sellist:') === 0) || !empty($field_spec['arrayofkeyval'])) {
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($field_spec['arrayofkeyval']) || !array_key_exists('0', $field_spec['arrayofkeyval'])))) {

View file

@ -5,6 +5,7 @@
* Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
* Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -239,7 +240,7 @@ if ($object->id > 0) {
$filters['search_agenda_label'] = $search_agenda_label;
$filters['search_rowid'] = $search_rowid;
$object->fields['label'] = array(); // Useful to get only agenda events linked to position (this object doesn't need label of ref field, but show_actions_done() needs it to work correctly)
$object->fields['label'] = array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 0, 'position' => 30, 'visible' => -1); // Useful to get only agenda events linked to position (this object doesn't need label of ref field, but show_actions_done() needs it to work correctly) - dummy but "valid" fields entry
// TODO Replace this with same code than into list.php
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);

View file

@ -345,9 +345,7 @@ foreach ($search as $key => $val) {
continue;
}
$field_spec = $object->fields[$key];
if ($field_spec === null) {
continue;
}
// Ignore false positive @phan-suppress-next-line PhanTypeMismatchArgumentNullable
$mode_search = (($object->isInt($field_spec) || $object->isFloat($field_spec)) ? 1 : 0);
if ((strpos($field_spec['type'], 'integer:') === 0) || (strpos($field_spec['type'], 'sellist:') === 0) || !empty($field_spec['arrayofkeyval'])) {
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($field_spec['arrayofkeyval']) || !array_key_exists('0', $field_spec['arrayofkeyval'])))) {

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2021 NextGestion <contact@nextgestion.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -1034,10 +1034,10 @@ while ($i < $imaxinloop) {
} else {
print $object->thirdparty->town;
}
} elseif ($key == 'fk_soc_member' && $adherent->id > 0) {
} elseif ($key == 'fk_soc_member' && $adherent->id > 0) { // @phpstan-ignore greater.alwaysFalse,booleanAnd.alwaysFalse
print $adherent->getNomUrl(1);
} elseif ($key == 'fk_soc_dateend') {
if ($adherent->id > 0) {
if ($adherent->id > 0) { // @phpstan-ignore greater.alwaysFalse
$datefin = $adherent->datefin;
if ($datefin) {
print dol_print_date($datefin, 'day');

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Alice Adminson <myemail@mycompany.com>
* Copyright (C) 2026 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -270,9 +271,6 @@ foreach ($search as $key => $val) {
continue;
}
$field_spec = $object->fields[$key];
if ($field_spec === null) {
continue;
}
$mode_search = (($object->isInt($field_spec) || $object->isFloat($field_spec)) ? 1 : 0);
if ((strpos($field_spec['type'], 'integer:') === 0) || (strpos($field_spec['type'], 'sellist:') === 0) || !empty($field_spec['arrayofkeyval'])) {
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($field_spec['arrayofkeyval']) || !array_key_exists('0', $field_spec['arrayofkeyval'])))) {