Fix : resource list was inaccessible if only one resource (#36042)

This commit is contained in:
Maxime Kohlhaas 2025-11-01 00:26:54 +01:00 committed by GitHub
parent 3f2f676e58
commit f5b56e5ea3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);