diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 402c60dd326..57f70f9eef5 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -888,12 +888,6 @@ parameters: count: 1 path: ../../../htdocs/asset/card.php - - - message: '#^Property Asset\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\}\>\) does not accept non\-empty\-array\\|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\ 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, position\: int, notnull\?\: int, visible\: int\<\-6, 6\>\|string, alwayseditable\?\: int\<0, 1\>\|string, \.\.\.\}\>\) does not accept non\-empty\-array\\|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 diff --git a/htdocs/categories/categorie_list.php b/htdocs/categories/categorie_list.php index c5e2e989573..c1ce32da04a 100644 --- a/htdocs/categories/categorie_list.php +++ b/htdocs/categories/categorie_list.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 Frédéric France - * Copyright (C) 2025 MDW + * Copyright (C) 2025-2026 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 @@ -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']))) { diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 97a1690b0d5..d2711e022b1 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2025 MDW + * Copyright (C) 2025-2026 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 @@ -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 ''; $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; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 38fc34643f1..ec81f6786ad 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024-2025 Frédéric France - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2026 MDW * Copyright (C) 2024-2026 Alexandre Spangaro * * 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; diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index a04e8bfb625..1d7b30598ce 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -5,7 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France - * Copyright (C) 2025 MDW + * Copyright (C) 2025-2026 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 @@ -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'])))) { diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 01f0827229c..d07da7883c7 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France + * Copyright (C) 2026 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 @@ -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); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index b9bd10fe308..70f3369f94d 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -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'])))) { diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 1ed446f111e..75627eacc1a 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2007-2017 Laurent Destailleur * Copyright (C) 2021 NextGestion * Copyright (C) 2024-2025 Frédéric France - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2026 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 @@ -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'); diff --git a/htdocs/webhook/triggerhistory_list.php b/htdocs/webhook/triggerhistory_list.php index 5fcd353f2f0..a4b74a80713 100644 --- a/htdocs/webhook/triggerhistory_list.php +++ b/htdocs/webhook/triggerhistory_list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2017 Laurent Destailleur * Copyright (C) 2024-2026 Frédéric France * Copyright (C) 2025 Alice Adminson + * Copyright (C) 2026 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 @@ -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'])))) {