From 92647d30e74c145837b12da230ce1190e2d7d6ff Mon Sep 17 00:00:00 2001 From: Christian Humpel Date: Mon, 21 Nov 2022 00:07:50 +0100 Subject: [PATCH 1/2] Fix #22768 remove "natural_search" on status and fk_parent_line. --- htdocs/mrp/mo_list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index e0b9a8f90da..2b0cdaa0c4d 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -174,6 +174,9 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; + if ($key == 'status'){ + $search[$key] = -1; + } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { $search[$key.'_dtstart'] = ''; $search[$key.'_dtend'] = ''; @@ -247,7 +250,7 @@ foreach ($search as $key => $val) { if ($key == 'status' && $search[$key] == -1) { continue; } - if ($key == 'fk_parent_line') { + if ($key == 'fk_parent_line' && $search[$key] != '') { $sql .= natural_search('moparent.ref', $search[$key], 0); continue; } From b5cafeefcf6e1d80fece565767e24edef87fece6 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 20 Nov 2022 23:16:19 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/mrp/mo_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 2b0cdaa0c4d..eacd731237c 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -174,7 +174,7 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; - if ($key == 'status'){ + if ($key == 'status') { $search[$key] = -1; } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {