Merge pull request #14230 from cfoellmann/fix-default-search

fix the global `DEFAULT_SEARCH_INTO_MODULE`
This commit is contained in:
Laurent Destailleur 2020-07-18 19:11:23 +02:00 committed by GitHub
commit cd997d216e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,10 +154,10 @@ if (empty($reshook))
$arrayresult = array_merge($arrayresult, $hookmanager->resArray);
} else $arrayresult = $hookmanager->resArray;
// This allow to keep a search entry to the top
// This pushes a search entry to the top
if (!empty($conf->global->DEFAULT_SEARCH_INTO_MODULE)) {
$key = 'searchinto'.$conf->global->DEFAULT_SEARCH_INTO_MODULE;
if (array_key_exists($key, $arrayresult)) $arrayresult[$key]['position'] = -10;
if (array_key_exists($key, $arrayresult)) $arrayresult[$key]['position'] = -1000;
}
// Sort on position