From f5b56e5ea3c2c1fd909f9fdfdfb3da48edbca81b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 1 Nov 2025 00:26:54 +0100 Subject: [PATCH] Fix : resource list was inaccessible if only one resource (#36042) --- htdocs/resource/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 236383bbed5..e1c2f243a8d 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -85,6 +85,8 @@ if (empty($sortfield)) { $sortfield = "t.ref"; } +$search_all = trim(GETPOST('search_all', 'alphanohtml')); + // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; @@ -349,7 +351,7 @@ if (!$resql) { $num = $db->num_rows($resql); // Direct jump if only one record found -if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && !$page) { +if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; header("Location: ".dol_buildpath('/resource/card.php', 1).'?id='.$id);